Is it possible to have file removed upon process exit?
Carlos A. M. dos Santos
unixmania at gmail.com
Sat Nov 27 16:42:29 UTC 2010
On Thu, Nov 25, 2010 at 6:14 PM, Xin LI <delphij at 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?
Did you try to use atexit(3) to register a deletion function?
More information about the freebsd-hackers
mailing list