Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.unix-wizards Subject: Re: /tmp versus temporary file types Message-ID: <1854@umcp-cs.UUCP> Date: Mon, 14-Oct-85 10:56:41 EDT Article-I.D.: umcp-cs.1854 Posted: Mon Oct 14 10:56:41 1985 Date-Received: Tue, 15-Oct-85 06:52:31 EDT References: <136@mcgill-vision.UUCP> <3793@garfield.UUCP> Organization: U of Maryland, Computer Science Dept., College Park, MD Lines: 29 Funny, Fred and I were talking about flink() and open(O_TEMP) mode just last week.... There are some problems. Flink is easy, but O_TEMP is not; not really. Basically, O_TEMP wants to open an unnamed file: to get an inode on some device, but to leave its link count zero. So for an O_TEMP open you do not care at all about the file name. Why, then, should you have to specify it? Well, you *do* care (presumably) about the device from which the inode is taken. After all, you are (most likely) going to flink the inode to a name once the file is built. But the device is normally just a part of the file name, and deduced by namei as mounted file systems are encountered in the path name. Fred suggested completely ignoring the `name' argument to open if you are using O_TEMP, and using u.u_cdir to get the device for the new inode. This seems a bit kludgy but would probably work. If you instead use the pathname to find the device, you run into a different problem: what if the named file exists? Namei currently will return the inode for that file. So you must also kludge namei to ignore the last file name argument. Somehow, this does not `feel' like the right solution either. Any suggestions? DMR, are you listening? -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu