Of files, lnks and existence
Of files, lnks and existence
- Subject: Of files, lnks and existence
- From: Brian Johnson <email@hidden>
- Date: Fri, 10 Jun 2005 16:36:43 -0700 (PDT)
It seems to me that when testing files for exisistence:
1. The Finder can test a file "x" for existence with
tell application "Finder"
set y to exists file x
end tell
This test recognizes soft link (lnk) folders, (and maybe Finder aliases)
but accepts 'displayed names" (i.e. files with hidden extensions) as the
same as true file names.
2. the "as alias" test in a try block
try
file x as alias
set y to true
on error
set y to false
end try
This test DOES NOT recognize soft link folders, but properly distinguishes
between displayed names and real names. That is, a file specification
which fails the "as alias" test may still be used with
set f1 to open for access
It seems that if I apply test 1 (which I used too do) and the file's name
has a hidden ".text" (for example), my script'll be screwed up when it
tries to open the file, but if I use test 2, it'll be screwed up if the
path is complex (and in my case, these are files accessed by cgi and
within an apache virtual-host web server structure on two different
volumes--their paths are complex).
It seems that you can't win. True?
- brian johnson, dept of architecture, university of washington, seattle
_______________________________________________
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