I’d like to index files in a local database but I do not understand how I can identified each individual file. For example if I store the file path in the database then the entry will no longer be valid if the file is moved or deleted. I imagine there is some way of uniquely identifying files no matter what happens to them but I have had no success with Google.
This will be for *nix/Linux and ext4 in particular, so please nothing specific to windows or ntfs or anything like that.
In addition to the excellent suggestion above, you might consider using the inode number property of the files, viewable in a shell with
ls -i.Using index.php on one of my boxes:
ls -iyields
196237 index.phpI then rename the file using
mv index.php index1.php, after which the samels -iyields:196237 index1.php(Note the inode number is the same)