[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: temporary files not deleted after exit

From: fork
Subject: Re: temporary files not deleted after exit
Date: Wed, 25 Aug 2010 19:35:47 +0000 (UTC)
User-agent: Loom/3.14 (

Muhali <muhali <at>> writes:

> in that case I would not use a temporary name. If none of these files are
> temporary, what then is a 'temporary' file?

tmpnam() returns a *string* suitable (unique, etc) for a temporary file, but
that is all.  The name of a file doesn't make a file temporary or not.  In *nix,
the idiom is that you make a file with tmpnam(), get its handle (an integer),
and unlink it immediately; this procedure allows you to write to it through its
handle, but prevents it from being visible to any other process.

tmpfile(), on the other hand, may be what you are looking for.

I have used neither of these functions, but I would recommend "help tmpfile".

reply via email to

[Prev in Thread] Current Thread [Next in Thread]