Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Permissions are like Rubik's cubes [SOLVED]



On Tue, 2 Sep 2008, Stephen J. Turnbull wrote:

Tod McQuillin writes:

> lsof is only part of the puzzle.  lsof can tell you which files are
> referenced by processes but it won't tell you which of them are not linked
> from any directory.

If a file is not linked, what does lsof use for a name?  I was
guessing that it would use a reference to the inode.

Yes, it does, but just because lsof uses a reference to the inode doesn't mean the file is unlinked, it just means it doesn't exist in the name cache.


In the general case, to map an inode number to a filename requires a complete traversal of the filesystem. Needless to say, lsof doesn't do this, it just looks in the name cache to see if the inode is associated with a filename there, and if so, it uses that filename. If the name cache entry for that inode has expired then lsof just tells you the inode number, even if the file isn't yet unlinked.
--
Tod




Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links