Date: Mon, 29 Nov 2010 00:20:35 -0800 From: Xin LI <delphij@delphij.net> To: Garrett Cooper <gcooper@FreeBSD.org> Cc: FreeBSD-Hackers <freebsd-hackers@freebsd.org>, d@delphij.net Subject: Re: Is it possible to have file removed upon process exit? Message-ID: <4CF36253.2090902@delphij.net> In-Reply-To: <AANLkTina9qH5g_uSauCe2jNEatkOdfixCuRYi_yLswY2@mail.gmail.com> References: <4CEEC3BD.3080204@delphij.net> <AANLkTina9qH5g_uSauCe2jNEatkOdfixCuRYi_yLswY2@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 11/28/10 20:43, Garrett Cooper wrote: > On Thu, Nov 25, 2010 at 12:14 PM, Xin LI <delphij@delphij.net> wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA256 >> >> Hi, >> >> One pretty common way of having an i-node of a file removed when process >> exit is to unlink() it while holding a descriptor of the file. This >> approach, however, have a side effect that other processes would not be >> able to access the file via its name. >> >> For certain applications it is sometimes desirable to (e.g. for unix >> domain sockets) have file removed when the process quit, regardless >> whether the process is quit cleanly. Is there a clean way to do this? > > Does it have to be nameless and/or unique? Not nameless. Speaking for uniqueness, I think it's unrelated (not good nor bad) for the use case. The name should be predictable (e.g. can be configured, so non-child process can find it), though. Cheers, - -- Xin LI <delphij@delphij.net> http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iQEcBAEBCAAGBQJM82JTAAoJEATO+BI/yjfBefYH/21GeUneFBCiTRUYqgjA6AIc QB9D5zqFFNEOWK4fEfa78MnmS7mDGUojfuU36eRsppHYErZ8wLC0evapc/Q45c07 BisQZB4pETNGk+Qv61f9Dd18+bZk+XfqJ5RALAvKiuv1gu0DN/XqTW5PHK25c1YQ nx187Uf6gB8sRHrCt/k5OZQ6hq/ACdWQOA2SvWYbgpPt3WbBRp2D3/qELATUyCRw b10Egkh+c4ovewbmX7tvXYJpOKANp59iFA/q5k/YVEY9MKYTog2ARmkzqPDi4g2B U7ertGMjXgWASfWKwp+mFjjf7stcsPlqpql/MHWMF4fm9Z1TpI91nQ9/wX4UCEs= =uXVP -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CF36253.2090902>