Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jul 2020 09:39:56 -0700
From:      David Wolfskill <david@catwhisker.org>
To:        Yuri <yuri@rawbw.com>
Cc:        Freebsd hackers list <freebsd-hackers@freebsd.org>
Subject:   Re: Is it possible to determine the open file path based on the file descriptor?
Message-ID:  <20200708163956.GO1462@albert.catwhisker.org>
In-Reply-To: <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com>
References:  <21b0280d-c290-f27f-98a9-0c2242380718@rawbw.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--3EG2G0wNthkGfxoY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 08, 2020 at 09:22:14AM -0700, Yuri wrote:
> Hi Hackers,
>=20
>=20
> One of the ports (sysutils/watchman) attempts to find the path of the=20
> file based on the file descriptor assuming that this descriptor=20
> represents an open file.
>=20
>=20
> 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
--=20
David H. Wolfskill				david@catwhisker.org
I'd far sooner question Donald Trump's loyalty to the US than Tammy Duckwor=
th's.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.

--3EG2G0wNthkGfxoY
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQGTBAEBCgB9FiEE4owz2QxMJyaxAefyQLJg+bY2PckFAl8F9txfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEUy
OEMzM0Q5MEM0QzI3MjZCMTAxRTdGMjQwQjI2MEY5QjYzNjNEQzkACgkQQLJg+bY2
PckkoQgAoGDAxQIrEI320H9dtQGBcjyw/B4DSOwLfa9VisAi+OlIW9/rrR0/KmEe
qVz9jLIYi/tvth1Wgoq5w1hKKDcHzpMAvzyiJ2RqZB8mO0cxys10AIE52eiX30Xd
F8uDCl0tRBS5ssuHNUq1+atYxXMirGWnnmEvEnsbEWzxFLNahys/KJWWxD+SLDWa
Zo+fiZdKW11QXReHuVXdfQLoF3O4VMsivkkYEmRDu6kJbPJtygksGBMXurGsohWP
PWPMqV854wnA4wE2vOK2cl5iuLERg/F/kqHGUBmcja78Vjq0wmlWXsy2zAs8o/Ek
ekVw5aWOA4VHDa3Ge5r1NXTajoNOfQ==
=OdTf
-----END PGP SIGNATURE-----

--3EG2G0wNthkGfxoY--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200708163956.GO1462>