Re: When is a file open but not open?
Re: When is a file open but not open?
- Subject: Re: When is a file open but not open?
- From: deivy petrescu <email@hidden>
- Date: Thu, 4 Aug 2005 18:56:05 -0400
On Aug 4, 2005, at 16:28, John Jones wrote:
Thanks Paul,
It's not permission problem in the file or directory, the script
routinely writes to that directory or other files in that
directory. There's something going on somewhere else with a
specific file. If I move the file to the trash the system won't
let me delete it because it thinks the file is busy.
John
John,
I've tried as much as I could to avoid using "open for access".
It always ends up causing problems.
Somethings you can do to avoid the problem:
a. close access to the file before you open.
b. when you close a file, do it twice.
Now, the best thing to avoid any problems is to avoid it altogether.
And, you can avoid it.
You can simply write to a file without opening it.
This is the script:
<script>
set pd to path to desktop as Unicode text
set pd to ("" & pd & "testanu123.txt")
tell application "Finder"
try
close access alias pd
end try
set j to open for access alias pd with write permission
close access j
end tell
write ("This is a test" & return) to file pd
write ("This is another test" & return) to file pd starting at eof
</script>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden