Re: Is this legit? [POSIX]
Re: Is this legit? [POSIX]
- Subject: Re: Is this legit? [POSIX]
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 24 Jul 2008 12:28:33 -0400
On Thu, Jul 24, 2008 at 10:23 AM, <email@hidden> wrote:
> Yet another solution is to use AppleScript's "read" command, as in:
>
> read file "path:to:symbolic:link"
> --> the target of the link
>
> (of course, don't use "alias" here)
or "POSIX file". In general, this feels very fragile to me, since it
(1) assumes that a symbolic link's contents is the target path
(technically an implementation detail, albeit a universal one TTBOMK),
and (2) relies on the further implementation details of when
AppleScript chooses to resolve symbolic links or not.
In descending preference for this particular need, I would like to ask
the system about time zone preferences by
(1) using a function designed to ask the system for time zone
preferences! This would avoid the need to rely on nit-picky details
of where that preference is stored (like in the 5th field in some
preference value or as the target of a symbolic link in the file
system).
(2) using a function designed to ask the system for preferences in
general, but using the nit-picky details to extract the time zone bits
in particular
(3) reading the target of a symbolic link using a function designed
for reading the value of a symbolic link - that is, the POSIX
readlink(2) system call, as exposed via either the readlink(1) shell
command or some programming API.
(4) reading the target of a symbolic link indirectly, e.g. running ls
-l and parsing the output.
(5) reading the target of a symbolic link by exploiting a loophole in
Applescript's treatment of such links.
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden