MACSCRPT Archives

May 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Mark J. Reed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 13 May 2008 11:42:55 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (12 lines)
You don't have to delete a file to replace it.  If you open it for
"write" (as opposed to "read/write" or "append"), it is automatically
truncated (emptied) and you get only what you write to it.

If you need to open it read/write, you can accomplish the same thing
by explicity truncating it when you're done writing.

But this is not really saving anything in terms of effort over just
creating a new file and moving it into place, which has the distinct
advantage that if something goes awry, you still have the old file to
fall back on.

ATOM RSS1 RSS2