[comp.sys.cbm] 154I drive problem

sl161004@silver.bacs.indiana.edu (David Chary) (04/13/89)

Could someone please identify this problem with the 154I disk drive:

Suppose I have a number of files, "FILE A", "FILE B",... "FILE n".
When I save FILE K using "@):FILE K", it does what it is told.
But later, I want to use FILE G, which I know is a different file.
so I load "FILE G" and much to my surprise it is "FILE K"!

What is happening to the disk or the drive?

Reply-To: sl161004@silver.bacs.indiana.edu

izot@f171.n221.z1.FIDONET.ORG (Geoffrey Welsh) (04/13/89)

 > From: sl161004@silver.bacs.indiana.edu (David Chary)
 > Message-ID: <3738@silver.bacs.indiana.edu>
 
 > Suppose I have a number of files, "FILE A", "FILE B",... "FILE n".
 > When I save FILE K using "@):FILE K", it does what it is told.
 > But later, I want to use FILE G, which I know is a different file.
 > so I load "FILE G" and much to my surprise it is "FILE K"!
 >
 > What is happening to the disk or the drive?
 
   *That* is the infamous "save@" bug, which was rumoured but never proven 
until the Transactor offered a reward for any software that could document it 
and Phil Slaymaker wrote a program that eventually caught it out.
 
   This is not just a 1541 oddity; it dates back to the 2040 drive and comes 
forward as far as the 1571 (the 1581, which required a drastically rewritten 
DOS, doesn't appear to suffer from the problem) and also affects the MSD 
SD-1 and SD-2 drives.
 
   The solution, I'm afraid, is to delete & save in stead of using SAVE@.
 


--  
 Geoffrey Welsh - via FidoNet node 1:221/162
     UUCP: ...!watmath!isishq!171!izot
 Internet: izot@f171.n221.z1.FIDONET.ORG

rcwlobe@klipper.cs.vu.nl (Reg Lobee) (04/13/89)

In article <3738@silver.bacs.indiana.edu>, sl161004@silver.bacs.indiana.edu (David Chary) writes:
> Could someone please identify this problem with the 154I disk drive:
> 
> Suppose I have a number of files, "FILE A", "FILE B",... "FILE n".
> When I save FILE K using "@):FILE K", it does what it is told.
> But later, I want to use FILE G, which I know is a different file.
> so I load "FILE G" and much to my surprise it is "FILE K"!
> 
> What is happening to the disk or the drive?

Each name in a directory has a pointer to the first block of the file.
The 'save and replace' option works by first saving the new file to
disk and then changing these pointers from the old to the new file.
The blocks the old file used are marked 'free' after the operation.
Sometimes the DOS changes the wrong pointers so a file with another
name points to the file you just saved. The file which shouldn't
have been changed is now lost. In your question "FILE G".
I don't know exactly when this error occurs. Sometimes it does, but
mostly it doesn't.
To avoid this risk you better use the scratch command to delete
the old file and then save.

Reg Lobee, rcwlobe@cs.vu.nl

TRM900@PSUVM.BITNET (Tony R. Marasco) (04/13/89)

In the note,"154I drive problem", sl161004@silver.bacs.indiana.edu (David Chary) says:
>
>Suppose I have a number of files, "FILE A", "FILE B",... "FILE n".
>When I save FILE K using "@):FILE K", it does what it is told.
>But later, I want to use FILE G, which I know is a different file.
>so I load "FILE G" and much to my surprise it is "FILE K"!
>
>What is happening to the disk or the drive?
>
>Reply-To: sl161004@silver.bacs.indiana.edu

A similar problem with the @:filename option happened to me, too.  The files
would expand to many more blocks than necessary, and sometimes the links to
the sectors would get garbled (hence, you problem).  I gave up on @:filename
completely.  When I want to update a file, I do:

OPEN15,8,15,"S0:filename":CLOSE15
SAVE"0:filename",8

I was using an older 1541 at the time, but I still don't trust @:...
-------
+-------------------------------------------------------------------------+
| Tony Marasco                 |  UUCP: psuvax1!psuvm!trm900              |
| Penn State University        |  BITNET: trm900@psuvm.BITNET             |
| Schuylkill Haven Highway     |                   - or -                 |
| Schuylkill Haven, PA 17976   |  trm900%psuvm.psu.edu@CUNYVM.CUNY.EDU    |
| "Questions are a burden for others.  Answers are a prison for oneself." |
|       -- The Prisoner                                                   |
+-------------------------------------------------------------------------+

mac@harris.cis.ksu.edu (Myron A. Calhoun) (04/14/89)

Regarding the 1541 "save with replace" bug:  I recently (within the last
two weeks) posted a summary of the bug, who discovered it, how to never
have it, etc.  If necessary, I could consult my sources and repost.

Basically, IF you EVER use save-with-replace, you must EITHER:
(a) ALWAYS use drive number 0 in EVERY disk operation or 
(b) ALWAYS reset the drive before every save-with-replace.

You may also avoid the problem entirely by scratching and then saving.
Or you can get around the whole problem by writing a better wedge or a
little BASIC code that implements one of the above solutions.
--
Myron A. Calhoun, PhD EE, W0PBV, (913) 532-6350 (work), 539-4448 (home).
INTERNET: mac@ksuvax1.cis.ksu.edu
BITNET:   mac@ksuvax1.bitnet
UUCP:  ...{rutgers, texbell}!ksuvax1!harry!mac

mketch@pawl.rpi.edu (Michael D. Ketchen) (04/14/89)

In article <2048.24456DA0@isishq.FIDONET.ORG> izot@f171.n221.z1.FIDONET.ORG (Geoffrey Welsh) writes:
> > From: sl161004@silver.bacs.indiana.edu (David Chary)
> > Message-ID: <3738@silver.bacs.indiana.edu>
> 
> > Suppose I have a number of files, "FILE A", "FILE B",... "FILE n".
> > When I save FILE K using "@):FILE K", it does what it is told.
      (etc.)
> > What is happening to the disk or the drive?
> 
>   *That* is the infamous "save@" bug, (etc.)
>   This is not just a 1541 oddity; it dates back to the 2040 drive and comes 
>forward as far as the 1571 (the 1581, which required a drastically rewritten 
>DOS, doesn't appear to suffer from the problem) and also affects the MSD 
>SD-1 and SD-2 drives.

Don't count on the new DOS for the 1581 getting rid of the bug.  I assumed
that Commodore had fixed the bug, and used the save-with-replace happily and
merrily until, BLAM!, one day I lost a whole track of data.  Just goes to
show, you can't judge a drive by its number!

>   The solution, I'm afraid, is to delete & save in stead of using SAVE@.

Amen!  I'll never stray again.

>--  
> Geoffrey Welsh - via FidoNet node 1:221/162
>     UUCP: ...!watmath!isishq!171!izot
> Internet: izot@f171.n221.z1.FIDONET.ORG


--------------------------------------------------------------------------------
mketch@pawl.rpi.edu (Internet) | Mike (Dave) Ketchen  | "Yes, Santa Claus, there
ketchenm@rpitsmts (Bitnet)     | Overworked Student   | is a Virginia..."
--------------------------"I say, anyone for tennis?"---------------------------