Quote:
Originally Posted by vinp
my question is whether it possible to get the complete path of a file from the file descriptor
|
Not elegantly. You have to get the device and
inode, then start from the root of the device and enumerate the directories, do a stat on each entry until you find a match.
And you can get multiple matches for the same
inode as a single file can have multiple names.
Also, a file does not *have* to have a name, for instance if you create a file then unlink it before you close it you have a valid file descriptor but no name in the file system.
So a single file can have zero or many names.