2

Is there a way to get the full path to the file based on its inode number ?

$inode = fileinode($path);
$path = ???
thelolcat
  • 10,995
  • 21
  • 60
  • 102
  • hey there is a similar question on SO, maybe that will help. http://stackoverflow.com/questions/1340263/what-is-the-fastest-way-to-find-all-the-file-with-the-same-inode – Samiullah Kaifi Mar 27 '15 at 11:56
  • Most filesystems store names in parent folder. So I guess you got to bruteforce search starting from root. Can take days maybe. – Pacerier Nov 21 '17 at 16:19

2 Answers2

1

You can check ffind tool on Sleuth Kit Libary (TSK), might help you.

ffind finds the names of files or directories that are allocated to inode on disk image image. By default it only will only return the first name it finds. With some file systems, this will find deleted file names.

User1911
  • 197
  • 1
  • 13
0

The following PHP snippet works for me:

$Command = "find ".__DIR__." -inum ".$Inode." -print";
$Result = shell_exec($Command);

Sources:

Arya
  • 566
  • 2
  • 9
  • 22