Search code examples
phpinode

Fast(er) way to get file inode using PHP


To grab the inode of a file in PHP, you can use this:

$fs = stat($file);
echo $fs['ino'];

The problem with this is EVERYWHERE says it's slow and you should avoid it. So the question becomes what's the fast(er) way to do it?


Solution

  • You could use fileinode() but you should run benchmarks if you think it is slow.