Skip to content

File_Exist

Include: Use System\FileSystem.pkg

See Also: DFPATH, Get_File_Path, Make_Directory, Make_Temp_File, Remove_Directory, Valid_Drive

Purpose

Checks whether a file or folder exists.

Syntax

File_Exist [FILE] {Path} [to] {Exists}

Arguments

FILE : Optional file driver. The FILE driver is optional; when omitted, file operations use FILE.

{Path} : File or folder path to check. See DFPATH for DF_OPEN_PATH behavior with relative file names.

{Exists} : Boolean variable that receives True when the path exists, or False when it does not.

Valid forms

File_Exist FILE sPath to bExists
File_Exist sPath bExists
File_Exist sPath to bExists

File_Exist returns True for existing files and directories and False for missing paths.

Example

Boolean bExists

File_Exist "name.txt" to bExists