File_Exist

See Also: File I/O Commands, Get_Directory, Make_Directory, Make_Temp_File, Remove_Directory, Valid_Drive, Get_File_Path

Purpose

Checks whether a file or folder exists.

Syntax

File_Exist {target} {result}

Where

What It Does

File_Exist returns a True if the specified target exists, and False if it does not. File_Exist will look for the target in the current working folder, unless a path name is provided as part of the file or folder specification. You may use any valid Windows file or folder specification (excluding wildcard characters), including universal naming convention (UNC).

Example

The sample checks whether the file "hello.txt" exists in the current working folder (since a path is not specified).

Procedure DoesFileExist

    Boolean bFileExists

    

    File_Exist "hello.txt"  bFileExists

End_Procedure

 

send DoesFileExist

Example

The sample checks whether the folder "C:\temp" exists.

Procedure DoesFileExist

    Boolean bFileExists

    

    File_Exist "C:\temp"  bFileExists

End_Procedure

 

send DoesFileExist

Notes