Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!rice!uupsi!cmcl2!panix!zink From: zink@panix.uucp (David Zink) Newsgroups: comp.unix.internals Subject: Re: (was slashes, now NFS devices) Summary: If statelessness were good the local disks would do it. Keywords: NFS Message-ID: <1991Mar8.010432.29216@panix.uucp> Date: 8 Mar 91 01:04:32 GMT Sender: zink@panix.uucp (David Zink) Followup-To: alt.flame Organization: PANIX - Public Access Unix Systems of NY Lines: 27 Or how's this common bit of code: FILE * get_temp_handle() { static char tmpl[] = "./cctmpXXXXXX"; char tmp[sizeof(tmpl)], *ptr; FILE *fp = 0; strcpy(tmp, tmpl); /* Initialize our template */ ptr = mktemp(tmp); /* Get the tmp file name */ if (ptr) /* If all possible names were not used up */ { fp = fopen(ptr, "w+"); /* Open the file for update */ unlink(ptr); /* Clean-up if we exit suddenly */ } return fp; } Never mind the old-timey style, equivalent things are still valid nowadays, and it does serve one useful added feature. It test whether the current directory is remotely mounted with NFS. -- David If you've been around long, you know this technique.