Re: Determine if a filename exists in a LARGE folder
Re: Determine if a filename exists in a LARGE folder
- Subject: Re: Determine if a filename exists in a LARGE folder
- From: Arthur J Knapp <email@hidden>
- Date: Fri, 15 Jun 2001 10:13:49 -0400
>
Date: Thu, 14 Jun 2001 19:47:59 -0400
>
From: email@hidden
>
Subject: Re: Determine if a filename exists in a LARGE folder
>
My favorite way to see if a file exists is to try to create an alias to it,
>
which will fail if it doesn't exist.
>
>
My most fully tested version of this technique is as follows:
>
>
to fileExists(filename)
>
try
>
filename as alias
>
return true
>
on error errMsg number eNum
>
if eNum is in {-35, -37, -43, -120, -1700 } then return false
>
-- -35 is "Disk wasn't found", -37: "Bad name for file",
>
-- -43: "File wasn't found", -120: "Folder wasn't found",
>
-- -1700: "Can't make [file specification] into an alias"
>
error errMsg number eNum -- repropagate other errors.
This is good stuff. :)
I would be curious to know if MacOS X has added any more file-errors,
relating to the "unix" file system.
Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden
Hey, check out:
http://www.latenightsw.com/freeware/JavaScriptOSA/