[comp.sys.atari.st] Ramblings about file safety

braner@batcomputer.UUCP (03/25/87)

[]

Some notes about file safety, besides 'back it up':

In my version of microEMACS, ^X^F lets you change the default file name.  If
you intend to save the modified file under a different name than the original, 
you should use ^X^F right at the start, in case you forget and press ^Z.
If you want to avoid saving the file by mistake, use Alt-E.  That puts micro-
EMACS in 'view-only mode', where both changes _and_ saves are not allowed.

In the April BYTE, in 'Best (really?) of BIX', Alex Leavens writes:

>  ... shell script [for micro-C-Shell] that will back up your source file,
>  and then run EMACS on it...
>
>	cp $1.c $1.bak
>	me $1.c

(since microEMACS itself does not do this).  May I suggest:

	if (-e $1) then
		cp $1 $1:r.bak
	endif
	me $1

(this works with non-.c files).  I call this shell script 'bak.sh', to remind
myself of the extra copy it does.  I would _not_ want to use 'bak' on a floppy!
I usually do all my work on the RAMdisk, where that extra copy is very quick,
and there is also that original copy on the floppy!  Later I 'cp' the new
version from RAMdisk over the old one on the floppy.  Note that the 'cp'
command in micro-C-Shell, when overwriting an existing file, first copies,
then removes the old version.  If the copy fails, you won't lose the original.
(This also explains the extra disk-drive time and sounds, and the failure to
overwrite a file on an almost-full disk: you get a 'write error'...)

- Moshe Braner