Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!tgr!root%bostonu.csnet@CSNET-RELAY.ARPA From: root%bostonu.csnet@CSNET-RELAY.ARPA (BostonU SysMgr) Newsgroups: net.unix-wizards Subject: Re: /tmp versus temporary file types Message-ID: <2152@brl-tgr.ARPA> Date: Tue, 15-Oct-85 22:01:19 EDT Article-I.D.: brl-tgr.2152 Posted: Tue Oct 15 22:01:19 1985 Date-Received: Thu, 17-Oct-85 20:27:09 EDT Sender: news@brl-tgr.ARPA Lines: 48 Just a design note: On our IBM system files are named on CLOSE rather than open (better put, *can* be named on close rather than open.) This leads one into a call sequence like: fd = open(NULL,O_CREAT...) ; ...write to it... close(fd,filename) ; besides tmp files it just generally guarantees that programs which for some reason, um, er, abend, and don't want things left around can have that (if you think about it, it's an easier way to handle a user ^C'ing a program, besides just providing a way to create temporary files, now one generally has to provide a signal handler that tries to carefully undo things on ^C, one assumes that any exit that tries to close an unnamed file without giving it a name will cause the file to disappear. If you think about it, that's actually a lot closer to the 4.2 socket design (this has nothing whatsoever to do with the current STREAMS/SOCKET discussions), a cleaner way to implement the above might be: fd = socket(AF_UNIX,SOCK_FILE,..) At this point, in this domain, writing would be legal, so would reading back after a seek, it would behave like a new file. then at some point where maybe it shouldn't be deleted but you are not ready to close yet: bind(fd,filename,..) and finally close(fd) One suspects that if the first method (close(fd,fname)) were offered then a need would arise to make a file have a name without having to close it (remember all those close(creat(fname,mode)) ; fd=open(...); code sequences so you could get a new r/w/seekable file!) Just trying to pull together several ideas. Ok, that settled, onwards to picking funny characters for the shell to interpret as DISP=(NEW,KEEP,DELETE) :-) -Barry Shein, Boston University hmm, we could make 'dd' a builtin and add a few new keywords...nahhh