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