Is it possible to determine the open file path based on the file descriptor?
David Wolfskill
david at catwhisker.org
Wed Jul 8 16:40:04 UTC 2020
On Wed, Jul 08, 2020 at 09:22:14AM -0700, Yuri wrote:
> Hi Hackers,
>
>
> One of the ports (sysutils/watchman) attempts to find the path of the
> file based on the file descriptor assuming that this descriptor
> represents an open file.
>
>
> Is this possible?
> ....
Not really. For one thing, the concept will be dependent on the design
and implementation of the file system, and in common cases (e.g., UFS),
there's no guarantee that a particular path is unique (as a given file
may have multiple links); there may also be symlinks, and an
intermediate node (directory) could be renamed at any point.
iAnd I'm sure there are other considerations that don't immediately come
to mind.
Peace,
david
--
David H. Wolfskill david at catwhisker.org
I'd far sooner question Donald Trump's loyalty to the US than Tammy Duckworth's.
See http://www.catwhisker.org/~david/publickey.gpg for my public key.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 618 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20200708/ffbfec33/attachment.sig>
More information about the freebsd-hackers
mailing list