Is there a SAVE "@:filename" bug in the 1541?

Discuss anything related to the VIC
Post Reply
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Is there a SAVE "@:filename" bug in the 1541?

Post by ral-clan »

I was reading some old Usenet postings and found this:

http://groups.google.ca/group/net.micro ... da9fe4ca9d

and this...

http://groups.google.ca/group/net.micro ... 7a577e7450

Is there some sort of bug in Commodore drives when you use the

SAVE "@:filename",8

to replace a file with a newer version?

I use this command a lot.... :(
User avatar
Schema
factor
Posts: 1430
Joined: Tue Mar 23, 2004 7:07 am
Website: http://www.jammingsignal.com
Location: Toronto, Ontario

Post by Schema »

Yes. Transactor magazine, and others, ran an extensive series of articles proving it existed. Summary here:

http://en.wikipedia.org/wiki/Commodore_ ... eplace_bug

That said, I've never run into it myself.
gklinger
Vic 20 Elite
Posts: 2051
Joined: Tue Oct 03, 2006 1:39 am

Post by gklinger »

Ah yes, the dreaded save with replace bug. It's strange how some people never encounter it and it is the bane of other people's existence. I ran into it a couple of times without knowing what had happened until I read about it in a magazine. Once you know about it, it's easy to avoid (or you could get JiffyDOS and never have to worry again). It was random enough that some people never encountered it and as a result there were long debates about whether it really existed or not.
In the end it will be as if nothing ever happened.
User avatar
eslapion
ultimate expander
Posts: 5458
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Post by eslapion »

So, the ROM upgrades I sell for the 1571 and 1581 fixes this bug.
Alan
Vic 20 Devotee
Posts: 280
Joined: Wed Mar 24, 2004 11:20 am

Post by Alan »

I have always heard that if you use the drive number, as in SAVE"@0:filename",8 that you will not get hit by the dread save-with-replace bug. I forget the reason.
Alan
Alan
Vic 20 Devotee
Posts: 280
Joined: Wed Mar 24, 2004 11:20 am

Post by Alan »

gklinger wrote:Once you know about it, it's easy to avoid (or you could get JiffyDOS and never have to worry again).
JiffyDOS eliminates the save-with-replace bug? I didn't know that. Are you sure?
Alan
User avatar
GreyGhost
Vic 20 Nerd
Posts: 525
Joined: Wed Oct 05, 2005 11:10 pm

Post by GreyGhost »

Was the problem fixed for the other commodore drives: 1541c,1571,1581?
Rob
User avatar
ral-clan
plays wooden flutes
Posts: 3702
Joined: Thu Jan 26, 2006 2:01 pm
Location: Canada

Post by ral-clan »

Alan wrote:I have always heard that if you use the drive number, as in SAVE"@0:filename",8 that you will not get hit by the dread save-with-replace bug. I forget the reason.
The Wikipedia article on Commodore DOS states that using @0: was not effective in solving the save-and-replace bug.
gklinger
Vic 20 Elite
Posts: 2051
Joined: Tue Oct 03, 2006 1:39 am

Post by gklinger »

It has been a long time so my recollection is a little fuzzy but I'm fairly sure the bug was only present in early 1541s as it was fixed once it was identified and it did not appear in later drives. As for JiffyDOS, I'm quite sure it does not have the bug. In fact, I remember an advert for JiffyDOS that specifically stated that the replacement ROMs "cured the 'save with replace' bug".
Last edited by gklinger on Thu Jan 11, 2007 1:57 am, edited 1 time in total.
In the end it will be as if nothing ever happened.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

From what I remember, the drive first stores the file under a temporary name, then deletes the original file and renames the new one. This may not be related to the other save-with-replace bug, but in any case when the amount of free blocks is less than the expected program size, you might not want to use the @ method IIRC.
Anders Carlsson

Image Image Image Image Image
User avatar
saundby
Vic 20 Enthusiast
Posts: 166
Joined: Wed Feb 22, 2006 11:55 pm
Website: http://saundby.com/
Location: Gold Country, CA

1540 affected, too

Post by saundby »

My old Vic-1540 drive had this same problem. In this one respect it was the worst of the drives I've had. It would trash the disk entirely if you tried to use SAVE@ at any time, and would trash disks at other times, too, such as when doing sequential writes.

I had tried having the store's tech replace the drive mech, to no avail, and eventually I had it swapped out under warranty and got a white 1541 that I still have. This drive still wouldn't save and replace, but at least it didn't trash disks as often.

I ended up writing a couple of disk recovery programs because of this problem. One would scan the disk surface and try to rebuild the BAM if that was all that appeared to be trashed. The other would painstakingly try to read off bad sectors until it got a good checksum, then would write it to another disk. I'd then go through the recovered sectors manually to see if they looked like they were really good as opposed to trash with complimentary errors. Both programs were slow, even by the standards of that time.

-Mark G.
Post Reply