• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
"exists" fooled by "rm"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"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

  • Follow-Ups:
    • Re: "exists" fooled by "rm"?
      • From: "Adam K. Wuellner" <email@hidden>
    • Re: "exists" fooled by "rm"?
      • From: Simon Forster <email@hidden>
  • Prev by Date: Re: Read a cell in Excel 2004
  • Next by Date: Re: "exists" fooled by "rm"?
  • Previous by thread: How do I set the window level to "on the desktop"?
  • Next by thread: Re: "exists" fooled by "rm"?
  • Index(es):
    • Date
    • Thread