"exists" fooled by "rm"?
"exists" fooled by "rm"?
- Subject: "exists" fooled by "rm"?
- From: Craig Knelsen <email@hidden>
- Date: Wed, 10 Nov 2004 09:57:39 -0600
I have a script similar to:
set tifolder to path to temporary items folder
set fname to (tifolder as string) & "date_check.dat"
tell application "Finder"
if not (exists item fname) then
set itExists to false
else
set itExists to true
end if
end tell
display dialog "fname = " & fname & return & "itExists = " & itExists
set refNum to open for access file fname with write permission
write "1 2 3" & return to refNum
close access refNum
When I run it for the first time, itExists is false as expected. The second time I run it, itExists is true as expected. However, if I then remove the file from the temporary items folder using "rm" from a Terminal window and then re-run the script, itExists is true! Why? I am running this script from the script editor.
_______________________________________________
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