Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!nbires!isis!jay From: jay@isis.UUCP (Jay Batson) Newsgroups: net.unix-wizards Subject: Re: two unix questions -- propriety of vi -r Message-ID: <1230@isis.UUCP> Date: Fri, 31-Oct-86 11:53:17 EST Article-I.D.: isis.1230 Posted: Fri Oct 31 11:53:17 1986 Date-Received: Mon, 3-Nov-86 20:52:22 EST References: <108@houligan.UUCP> <843@uvacs.UUCP> Reply-To: jay@isis.UUCP (Jay Batson) Organization: University of Denver Math and Computer Science Lines: 45 In article <843@uvacs.UUCP> rwl@uvacs.UUCP (Ray Lubinsky) writes: >> 2) Why does 'vi -r file' not set the 'dirty bit' (or whatever it's called) >> so that an immediate exit with ZZ will save the file. I lost some >> changes after a crash because I had to leave and in my haste just >> entered vi (ala above) and exited with ZZ. This did not save my file. >> I think it should have. Any thoughts? > > Just as I was diddling >with a copy of one of the source files, the system crashed. When we came back >up, I got mail saying that the edit buffer had been saved, even though I had >just written the file a few minutes before the crash. > >Rather than just overwrite what I had, I did a diff on my most recent version >and the version saved by vi(1)... Sure enough, *my* version was more up-to- >date than the saved buffer. > >Why does ``vi -r'' do what it does? Because you *need* to evaluate whether the >saving of the edit buffer was successful or not. This last sentence is the key. I have callus-interruptus (call-waiting) on my phone. When I've dialed in to a system, and the interruption happens, vi will sometimes save garbage as I'l logged off - something like a file full of control characters with none of the text I've written. Has to do I imagine with the clicks that callus-interruptus makes to the system when it happens. In that case, I certainly don't want vi to save that crap to the detriment of my original text. I may have an sccs or rcs file around to get a decent version from, but if I've made lots of changes since I got one last, I'd be out of luck if vi did what was originally asked here. One day I guess I'll figure out a good place to call-forward calls to before I get on the modem, and maybe stop this interruption problem. Oh well, the hazards of being paranoid about missing an important call.... -------- "Stop it!! Stop it now. This is getting silly again, and this silliness has _got_ to stop. Go on to the next sketch. Go on. Turn this camera o " Jay Batson ihnp4!onecom!\ isis!jay seismo!{hao,nbires}!/