PHP Function Reference

PHP fileinode() Function



The PHP fileinode() function returns the inode number of the specified file.

Note: The results of this function are cached. Use clearstatcache() function to clear the cache.

Syntax

fileinode(filename)

Parameters

filename Required. Specify the path to the file to check.

Return Value

Returns the inode number of the file, or false on failure.

Exceptions

Upon failure, an E_WARNING is thrown.

Example:

Lets assume that we have a file called test.txt in the current working directory. The example below demonstrates on using this function to get the inode number of the file.

<?php
$filename = 'test.txt';

//getting the inode number of the file
echo "inode number: ".fileinode($filename)."\n";
?>

The output of the above code will be:

inode number: 1042196

❮ PHP Filesystem Reference