Checks if file or a directory exists in the file system
variable = object.Exists(full_path_name)
full_path_name - The full path name of the file or
directory you want to check.
0 - does not exist (nor file nor directory)
-1 - The full_path_name parameter matches existing
1 - The full_path_name parameter matches existing file
Set sf = Server.CreateObject("newObjects.utilctls.SFMain")
Select Case sf.Exists("C:\FileOrDir")
Response.Write "<B>Error there is a directory with the name specified</B>"
' The file exists - use it ...
' No file exists - create new for example or do something else
This is more universal function than FileExists or FolderExists
and allows the application to check in turn if there is an object
with a given name and what kind of object is it. While FileExists/FolderExists
methods are provided mostly to simplify porting of existing
applications that use FSO (FileSystemObject) this method is
recommended for the new applications as it is more convenient.
Applies to: SFMain
Windows 95/NT and later
Windows CE 3.0 and later
Pocket PC/Windows Mobile 2003 and later
Windows CE.NET 4 and later