fstat and filenames

Denis Eremenko moonshade at pnhz.kz
Thu Dec 20 19:11:28 PST 2007


В пт, 14/12/2007 в 09:03 -0500, Lowell Gilbert пишет:
> moonshade at pnhz.kz (Denis Eremenko) writes:
> 
> > Why fstat so secretive about file names and unix domain sockets?
> 
> With respect to file names, you need to remember that there may not be
> a unique answer.  A file handle's metadata doesn't keep information
> about how it was opened, just the inode.  That inode could belong to
> multiple directory entries, or none -- this is why, as the fstat(1)
> manual points out, "there is no mapping from an open file back to the
> directory entry that was used to open that file."

Yes. I clearly understand difficulties of exact inode-name mapping. And
i saw manpage note too. But doesn't _some_and_maybe_wrong_ information
better than nothing? Additionally - most files has one filesystem
record.

> As far as unix domain sockets, I don't understand the question.  Sorry.
fstat doesn't show their names too.



More information about the freebsd-fs mailing list