home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!elroy.jpl.nasa.gov!ucla-cs!ratner
- From: ratner@ficus.cs.ucla.edu (David Ratner)
- Subject: Re: /tmp files
- Message-ID: <ratner.712606467@ficus.cs.ucla.edu>
- Sender: usenet@cs.ucla.edu (Mr Usenet)
- Nntp-Posting-Host: ipswich.cs.ucla.edu
- Organization: UCLA, Computer Science Department
- References: <1992Jul31.095122@is.morgan.com>
- Date: 31 Jul 92 18:14:27 GMT
- Lines: 24
-
- scairns@is.morgan.com writes:
-
-
- >Is there a system call to randomly generate unique file names
- >in /tmp?
-
- >Or alternatively, anyone have any code examples which do this?
-
- >I need to send output temporarily to a unique file in /tmp, do some
- >work with it and than discard it.
-
- >Thanks in advance.
-
- Usually, people use the process-id of the running process and append that
- to some set string to get a unique, temporary filename. (The process-id
- is guarranteed to be unique until the program exits).
- Use getpid() to get the process id.
-
- Dave
- --
- * * *** * * | Dave "Van Damme" Ratner
- * * * * * * / \ ratner@cs.ucla.edu
- * * * * *** \ /
- *** *** *** * * | "Wham Bam, thank you Van Damme!"
-