🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #37752

What's the "best" way to save a file?

#37752
From: Anton Rang
Date: Tue, 14 Feb 1989 04:16
24 lines
1711 bytes
While watching all the discussion on the great Microsoft Word Save As
fiasco, I started thinking about the best way to do a "Save As" (or a
"Save", for that matter).  It seems to me that the following is the
safest way to do it, if the file is going to be saved "on top of" an
existing file.

	1. If doing "Save As", ask the user for the filename.
	2. Write out the new file, with some temporary name.
	3. Rename the "old file," if it exists, to a temporary name.
	4. Rename the new file to the old file's name.
	5. Delete the old file.

  The "old file" is the existing file; the "new file" is the one just
being saved.  The advantage of doing this is that the old file isn't
removed until the new file has been successfully written.  The
disadvantage is that you can't use "Save As" to free up disk space by
saving on top of an existing file.
  What do people think of this idea?  What are the biggest problems
you see with it?

+---------------------------+------------------------+----------------------+
| Anton Rang (grad student) | Things could be worse. | "Do worry...be SAD!" |
| Michigan State University | rang@cpswh.cps.msu.edu |                      |
+---------------------------+------------------------+----------------------+
Technical Details
Message-ID: <1811@cps3xx.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!eecae!cps3xx!rang

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!eecae!cps3xx!rang
From: rang@cpsin3.cps.msu.edu (Anton Rang)
Newsgroups: comp.sys.mac,comp.sys.mac.programmer
Subject: What's the "best" way to save a file?
Message-ID: <1811@cps3xx.UUCP>
Date: 14 Feb 89 04:16:23 GMT
Sender: usenet@cps3xx.UUCP
Reply-To: rang@cpswh.cps.msu.edu (Anton Rang)
Distribution: na
Organization: Michigan State University, Computer Science Dept.
Lines: 24