Hitachi

JP1 Version 11 JP1/Script Description and Reference (For Windows Systems)


8.9.6 IsExistFile (check whether a file exists)

Purpose

Checks whether a file exists and returns True or False.

Syntax
IsExistFile (FilePath)
Argument
FilePath

Specify the full path of the file as a string or as a variable that stores this value.

Description

The IsExistFile command checks whether a file exists. The command returns True if the file exists, or False if not.

Supplement

If the specified folder name exists in the file to be checked, the command returns True as the execution result.

Note

Take care when specifying a file in the folder set in the environment variable ProgramFiles (normally the Program Files folder on the system drive) or WinDir (normally the Windows folder on the system drive). For details, see 1.8.2 Command behavior.

If you specify an existing folder name as the path of the file to be checked, the command returns True as the execution result.

Even if you do not have access permissions to read the existing folder specified by the path of the file being checked, the command returns True if the file exists.

Example
path1 = _BIN_+"SCRIPT\Logging.txt"
If IsExistFile (path1) = True Then
  Copy (path1, _TEMP_+"ScpLog.txt")
  If _COPY_RTN_ <> Skip Then
    DeleteFile (path1)
  End
End
JP1/Script version

Supported from JP1/Script 01-00.