stat

  • We use the stat function in PHP to get an associative array with information about a file:

    PHP

    $stat = stat('/path/to/foobar');
    print $stat['ino'];
     
    //=> 16793883

    Ruby’s File.stat method will return a File::Stat instance with the same information.

    Ruby

    stat = File.stat('/path/to/foobar')
    p stat.ino
     
    #=> 16793883

    see also

Looking for Rails or PHP web application development, integration, and training?

Rails for PHP is brought to you by Maintainable Software. Get custom web applications and personalized training from the authors of the book and website.