Hi,

I'm writing an app that associates metadata to files in a directory hierarchy. Not all relevant filetypes allow embedding of metadata, so it is kept in a separate database.
The user might have modified the files while my program was not running, so it can
scan the directory and compare the results to that of a previous scan.

Let's say it turns out that two files were missing and two new files have appeared.
This can be because
  1. Two files were deleted and two other files created, OR
  2. Two files were renamed

In the first case, the metadata associated with the missing files should also be removed.
In the second case, the metadata should be transferred over to the new files.

So how can one tell which of 1) and 2) has happened?
I have considered matching them by remembering the filesizes, but it is not unique enough to identify a single file among many.
Another option is to compute a hashcode of the file's contents (to see if any of the "new" files have the same code as a "missing" one), but that would make importing large amounts of files into the directory very slow.
The best solution I have so far is to identify the files by inode-number, as I've noticed that it will not change when a file is moved or renamed within the filesystem.
However, QFileInfo does not have a method to return the inode-number, making the solution Linux-specific. Is there a more portable way?