Path: utzoo!utgpu!attcan!dptcdc!lethe!dave From: dave@lethe.UUCP (Dave Brown) Newsgroups: comp.unix.wizards Subject: Re: getcwd() and friends. (Really initiating files) Message-ID: <2114@lethe.UUCP> Date: 9 Apr 89 20:48:44 GMT References: <3675@ficc.uu.net> <14689@rpp386.Dallas.TX.US> <811@mtxinu.UUCP> <2001@unisoft.UUCP> <3746@ficc.uu.net> Reply-To: dave@lethe.UUCP (Dave Collier-Brown) Organization: News courtesy of Systems Software Lines: 23 In article <3746@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes: | How about O_TOKEN which returns a fd you can't do anything to until you | do another open on it. Soirt of like an RMX file token or an AmigaDOS | file lock. Have to call the fd version of open something other than | fopen or fdopen, though. | ... | Do this cleverly enough and almost all the regular calls can actually use | the new calls... you just need to keep 'open' around so you can get the | fd in the first place: Good idea. Historically, Unix made open out of "initiate" and "open", (since one rarely initiates a file without opening it), and allowed most operations on the file be done via a fd or a filepointer. It might make some sense to reinvent initiate, but I like the idea of an O_DONT_YOU_DARE_OPEN_THAT mode to open... --dave -- David Collier-Brown, | {toronto area...}lethe!dave 72 Abitibi Ave., | Joyce C-B: Willowdale, Ontario, | He's so smart he's dumb. CANADA. 223-8968 |