Joe Schaefer <[EMAIL PROTECTED]> writes:
> I'm not sure where this comes from- neither my man pages nor my
> glibc2 info documentation say this. Quite frankly, I'd ignore it
> since it's utter BS. On linux, "mkstemp" is just as good as
> "tmpfile" since it's coded as "tmpfile" + "remove" - thus the file
> is gone once the stream to it is closed. IME, mkstemp works just
> fine on linux.
Hrmm, I don't think it's removed.
#include <stdio.h>
int main()
{
int fd = 0;
char storage[100] = "/tmp/testXXXXXX";
fd = mkstemp(storage);
write(fd, "123456789\n", strlen("123456789\n"));
printf("file is %s\n", storage);
close (fd);
}
I still have the files sitting around, complete with contents.
I don't know... I like the idea of giving someone a filename and
letting them do what they want with it, which may or may not include
opening the file.
--
David N. Welton
Personal: http://www.efn.org/~davidw/
Free Software: http://people.debian.org/~davidw/
Apache Tcl: http://tcl.apache.org