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 Lively <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 13 May 2008 11:46:36 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (31 lines)
On May 13, 2008, at 10:55 AM, Bill Steele wrote:

> I'm writing RSS files. When the file needs to be updated, I've been  
> deleting the old version and writing new text to a new file. Seems  
> like a lot of extra work. But if I write the new text to the old  
> file "starting at 0" what happens if the old text is longer than the  
> new?
>
> I can write spaces to the file from 0 to eof, but then I might end  
> up with a bunch of wasted space at the end.
>
> Doing ACME Replace on the entire text also seems a bit extreme.
>
> Is there a simple way to wipe the contents of the file without  
> deleting and recreating?
>
> I'm prepared to feel stupid if it turns out to be really obvious.
> -- 
>
> Bill Steele
> [log in to unmask]
>
set mylun to open for access posix file "/tmp/junk.txt" with write  
permission
write myText to myLun starting at 0
Set eof myLun to (count myText)
close access myLun

-Mark
cat /dev/random > /tmp/junk1.txt

ATOM RSS1 RSS2