Re: POSIX file wierdness
Re: POSIX file wierdness
- Subject: Re: POSIX file wierdness
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 06 May 2005 08:14:25 -0400
on 2005-05-06 7:04 AM, Alastair at email@hidden wrote:
> To reproduce, enter the following into the Script Editor:
>
> class of POSIX file "foo"
I don't know about your theory of what's going on underneath, but:
Is 'POSIX file "foo"' correct syntax?
It certainly isn't a complete path. In my experience (under Tiger, too), a
partial slash-delimited path causes the 'POSIX file' command to return a
result in which the path string has a leading colon. While path strings with
leading colons work in Panther to some extent (don't they always imply the
startup volume?), it has always been considered incorrect syntax (per
official Apple pronouncements) and is not guaranteed to continue working.
> Compile this, and the script itself changes to
>
> class of file ":foo"
And if you avoid the compile-time conversion by putting the path into a
variable, the result of the 'POSIX file <my variable>' command will also
have a leading colon, which is incorrect AppleScript usage.
> This is OK, it still runs and gives the expected result:
>
> «class furl»
Yes, in Panther. As noted above, this is not guaranteed to continue working
in future.
If you pass a full POSIX (i.e., slash-delimited) path string to 'POSIX
file', you should get correct results.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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