file-exists( filename a, [canread b],[canwrite c],[istype d],[modified e])


Checks if a file or directory (or a special file or named pipe on Unix systems) exists. Parameter a specifies the name (including relative or absolute path) of the file. The optional parameters b to e allow further checks.

The function returns true if all checks finished successfully. Parameter c set to true checks if it is allowed to write to the file, b set to true if it is allowed to read from the file. d allows to restrict the type of file to files (f, file, datei) or directories (d, directory, folder, verzeichnis) or a combination of both (d|f). If e is set it will be checked if the file has been changed within a given time. If e is set to a timestamp or date, it is checked if the file has been changed after that time, if e is set to the form now-<milliseconds>, it will be checked if the file has been changed within the last milliseconds as being specified, e.g. now-60000 check for a modification within the last minute.

Description of Parameters

Parameter

Description

a

Relative or absolute pathname.

b

(optional) true to check if the file is readable. Default: false.

c

(optional) true to check if the file is writeable. Default: false.

d

(optional) Restriction to specific filetypes.

e

(optional) Last modification check (absolute date or relative milliseconds).