Re: Creating folders (directories) without the Finder
Re: Creating folders (directories) without the Finder
- Subject: Re: Creating folders (directories) without the Finder
- From: "Arthur J Knapp" <email@hidden>
- Date: Thu, 22 Mar 2001 11:20:09 -0500
>
From: email@hidden
>
Date: Thu, 22 Mar 2001 00:41:17 EST
>
Subject: Re: Re: Creating folders (directories) without the Finder
>
... I had a venerable but
>
occasionally unpredictable plain vanilla handler trio that has performed that
>
task for me, but I discovered Akua has the very wonderful "verify path"
>
command.
>
verify path "HD:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z"
>
Blazing fast (over 1000 folders a second in more detailed tests), one line of
>
code rather than 24, and I should expect, rock solid stable. Exactly what I
>
need. Thanks a bunch!
Good stuff. :)
If these paths are just strings, there is another non-Finder method
you could use. I haven't speed tested it, but no scripting additions
are required:
on verifyPath( pathString )
try
alias pathString
on error
return false
end try
return true
end verifyPath
This second handler is just an example of how you can extract
more information about the existence/non-existence of the path:
on verifyPath( pathString )
try
alias pathString
on error errmsg number errnum
if errnum = -35 then
return "disk does not exist"
else if errnum = -120 then
return "a folder does not exist"
else if errnum = -43 then
return "the file does not exist"
else
error errmsg number errnum
end if
end try
return "exists"
end verifyPath
Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden
Hey, check out:
http://home.earthlink.net/~eagrant/