Classic Computer Magazine Archive COMPUTE! ISSUE 57 / FEBRUARY 1985 / PAGE 10

The Great Commodore
Save/Replace Debate

I have a Commodore 64 and a 1541 disk drive. Recently I saved a program on a disk and later saved another program on the same disk. When I tried to load the first program, I was surprised to get the second instead! What happened? How can I get my first program back?
Jason Stearns

Assuming there's no mysterious hardware error, it's possible that you saved the second program with the save/replace command (SAVE "@0.filename",8). When you precede a filename with the at sign (@), the computer first saves the new file with the same filename before erasing the old file. The purpose of save/replace is to make it easier to update files on a disk in one step. (Some computers do this automatically.)
    The save/replace command is a controversial subject among some Commodore users. For years it's been rumored that save/replace contains a bug which can scramble programs and disks, but it's unpredictable and therefore very difficult to confirm. Usually it seems to happen when you are using a disk with less than 100 blocks free. We recently lost a file after using save/replace and spent hours trying unsuccessfully to duplicate the error.
    One programmer, convinced that save/replace works, has offered a reward to anyone who can prove otherwise. COMPUTE!, however, has concluded that where there's smoke, there might be fire; mangled disks can be so frustrating, lost files can be so difficult to replace, we don't think the added convenience of save/replace is worth the risk.
    To be safe, avoid using save/replace. Instead, save the program with a different filename, maybe with a .V2 extender (for version 2). The next file can be .V3, etc. Then rename the file after you have a final debugged version and delete all the early versions.
    Your first program was probably still recorded on the disk after it seemed to disappear, but to recover it you would need a disk editor utility. Such a utility lets you read the directory map and change the byte which signifies a deleted file. However, even this works only when you haven't saved any other files on the disk in the meantime. It's also easy to destroy other files if you aren't sure how to use the utility.
    It's a good practice to always save copies of important programs and data files on backup disks which are stored away from your main disks. If you upgraded to disk front tape, you can also save backups on your old cassettes.