[comp.sys.atari.st] serial numbers; ... and how to loose files

jbww@eagle.ukc.ac.uk (J.B.W.Webber) (04/09/88)

Yet Another Way to Loose Files.

I am posting this note, as I have not seen this particular little 
side effect mentioned before, on the net.  

It may catch those of you  that work in an environment with a number of
STs, or who leave machines at work and at home permanently on. The sort
of time it will strike is if you are  `multi-tasking'  on more than one
machine -  i.e. writing in 1stWordPlus on one machine,  taking the disk
to another to run 1stWord_to_Postscript, and send the PS to laserprint.

The scenario :
		ST 1					ST2
	Write file A
				take disk to ST2
							read A, transmit A.PS
				take disk to ST1
	Write file B
				take disk to ST2
							!!! where is file B ???

Even if you hit escape, hear the drives whir, and know it is reading the disk,
still no sign of the file.

are the disk drives Out Of Alignment; is it THE VIRUS  ???
No, it your friendly TOS striking again !
Remember, TOS is checking, noticing that the disk has gone and come, 
so it reads the serial number, finds it is the same, AND SO DOES NOT
UPDATE IT'S INTERNAL COPY.   (How much time dies this save? On a disk
with 50 to 100 files in the top directory, about 2 to 4 sec will pass
from hitting escape to the first flicker of the bee, if the disk is the
same; if it is different, the time will be lengthened by about 0.2 sec
-  you can use this to verify the effect on just one machine).

How can one force it to update the directory ?      :
 a)	close the desktop window on the disk, and re-open it.
 b)	run Moshe Braner's  uproot.
 c)	force a directory read on a different disk, then re-insert the first.
	(I now do this as a matter of course, when working between machines).

	This gave one a panic, but did not actually loose a file.
	It is, I regret, very easy to also over-write files.

If in the above example the postscript file had been written back to 
the same disk, ST1 would not have known of it, and would probably have
then gone on to write fileB over the postscript file.

Is there anything that one can do to completely avoid this problem ?
One answer would be if TOS always fully re-read any disk that has left
the drive;  this is a fairly major change.
 Another possibility would be to keep a note of the time the disk was
last updated, and to check this against that on the disk.
 One option that has occurred to me is to re-write some or all of the
serial number each time a file is written, at the same time the
directory is updated. This would have the advantage that any other
standard ST (without the modification) would read the disk correctly.

 I don't know what people think of this,  or how tricky it would be. 
(Perhaps a modified trap, shades of the virus discussion, where we came in).
No flames on the latter, please, sorry this has become so long, hope it
saves someone some grief, although the problem is fairly obvious when 
one is looking at it.
				jbww@Ukc.ac.uk