Re: open file for overwriting
Re: open file for overwriting
- Subject: Re: open file for overwriting
- From: Emmanuel <email@hidden>
- Date: Wed, 15 Oct 2003 21:08:05 +0200
At 1:35 PM -0400 15/10/03, Deivy Petrescu wrote:
>
On Wednesday, Oct 15, 2003, at 01:15 US/Eastern, Rua Haszard Morris wrote:
>
>
>Hi all,
>
>
>
>I'm trying to use open for access to open a file for writing to. If the
>
>file exists, I want it to be overwritten.
>
>
>
>I can't find an option for this, and an error occurs if I try to use open
>
>for access on a file that exists.
>
>
>
>How do I do this? Normally it's an option in the file open func..?
>
>
>
>Cheers,
>
>Rua.
>
>
>
>
Rua,
>
do not be polite, be rude, just write to the file without asking for permission...
>
If what you are writing is longer than what you have, the file gets overwritten.
>
>
write "I can not believe this will work" to file "path to file"
Seconded. Use "open for access" only if you call repeatedly "read" or "write" (the number returned by "open for access" makes a faster access than the path). Use "open for access with write permission" only to create a file.
Also, I think it has been advised on this list by an authority not to pass a path in a string to those commands. Use the "file blah" construct.
Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.