Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Nov 2010 14:42:28 -0200
From:      "Carlos A. M. dos Santos" <unixmania@gmail.com>
To:        d@delphij.net
Cc:        FreeBSD-Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Is it possible to have file removed upon process exit?
Message-ID:  <AANLkTinK-xXgzxcRA9XW7XfGHPHyaxZzc2TwT%2BWpB9U7@mail.gmail.com>
In-Reply-To: <4CEEC3BD.3080204@delphij.net>
References:  <4CEEC3BD.3080204@delphij.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 25, 2010 at 6: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. =A0This
> 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. =A0Is there a clean way to do this?

Did you try to use atexit(3) to register a deletion function?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinK-xXgzxcRA9XW7XfGHPHyaxZzc2TwT%2BWpB9U7>