Re: How to determine if a folder exists on a system?
Re: How to determine if a folder exists on a system?
- Subject: Re: How to determine if a folder exists on a system?
- From: Philip Aker <email@hidden>
- Date: Wed, 8 Jul 2009 14:23:40 -0700
On 2009-07-08, at 13:37:36, Mark J. Reed wrote:
On Wed, Jul 8, 2009 at 4:34 PM, Emmanuel LEVY<email@hidden>
wrote:
I trust that the bug never hit you, but you can trust me too:
I don't doubt you! Just hadn't heard of this before.
Now you certainly see my point: since you don't want to feed mkdir
with a
path which would include a symlink, you really to have mkdir's
recursive job
by yourself: since you have to figure out the resolved path, you
have to
figure out what level the hierarchy already exists up to.
Right, but the straightforward way of doing that doesn't change the
behavior from mkdir -p, since [ -d ] returns true for symlinks. You
would have to do [ -d "$d" ] && [ ! -L "$d" ] or something to avoid
the symlink problem...
The problems with mkdir -p I know about would be from a permissions
error.
Also I heard about, but never actually experienced in practice, that
aliases on _really old_ Mac systems may not have been mapped to a
symlink so:
mkdir -p /foo/bar/SomeAlias/chocolate
would fail because the unix level wouldn't see the alias as a
resolvable symlink. And, if the system was that old, it might not even
have 'POSIX file' implemented.
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
Democracy: Two wolves and a sheep voting on lunch.
_______________________________________________
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