Jim Lesurf writes:
Richard Kettlewell wrote:
1. If the environment variable TMPDIR is set, use that instead of /tmp.
2. Don't use predictable filenames; /tmp is shared between multiple
users. (Get this wrong and you will introduce security problems.)
If you don't care about the filename, the easiest policy is to use
tmpfile(). That'll given you an anonymous file somewhere sensible.
I'm not clear how that would work for my requirement. I'm using system() to
launch flac and have it put its output into a file which I specify by its
name. Then my main program uses that name to fopen() the file and read from
it.
AIUI tmpfile() will give me a file 'handle' (FILE*) but no name. How would
I use that as part of the command string for flac?
“If you don't care about the filename” means exactly that. It sounds
like you do care about the filename.
--
http://www.greenend.org.uk/rjk/