Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!genrad!decvax!decwrl!hplabs!sdcrdcf!psivax!nrcvax!chris From: chris@nrcvax.UUCP (Chris Grevstad) Newsgroups: comp.unix.wizards Subject: Re: unlinking open files (was Re: Seek on a pipe) Message-ID: <960@nrcvax.UUCP> Date: Sun, 21-Jun-87 15:42:03 EDT Article-I.D.: nrcvax.960 Posted: Sun Jun 21 15:42:03 1987 Date-Received: Tue, 23-Jun-87 04:26:13 EDT References: <6695@auspyr.UUCP> Reply-To: chris@minnie.UUCP (Chris Grevstad) Organization: Frobozo Items Co. Inc. Ltd. Lines: 31 mick@auspyr.UUCP (Mick Andrew) says: >in article <7074@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) says: >> * We use the despicable trick of unlinking an open temporary file. >> * The alternatives are too painful. > ... > ... >But for real-world honest-to-god live applications, this seems like the >best solution to avoid leaving temp file clutter lying around >on poorly understood and administered Unix boxes. > Well, there are a couple of problems with this approach in real life. First is that it is not necessarily portable. VMS refuses to unlink an open file. I would make the assumption that there are other os's that feel the same way. Another problem is when you later need to reference this unlinked file by its name, rather than file handle (either fd or fp). Tough to do when the file's already gone. VMS attempts to solve this problem by having an additional flag on open, to indicate that this is indeed a temporary file and should be deleted on the last close. Unfortunately, it's functionally equivalent to, under UNIX, unlinking an open file, thus removing the file name from the file system and making it invisible for other applications that might need to see the file. -- Chris Grevstad {sdcsvax,hplabs}!sdcrdcf!psivax!nrcvax!chris ihnp4!nrcvax!chris As Mad Max was wont to say: So-so-so-so-so-so-sorry about that, Chief!