two unix questions -- propriety of vi -r
Jay Batson
jay at isis.UUCP
Sat Nov 1 02:53:17 AEST 1986
In article <843 at uvacs.UUCP> rwl at 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}!/
More information about the Comp.unix.wizards
mailing list