JavaScript function: isfileexist

Determines whether a file exists or not.

Syntax

isfileexist(“filepath”)

Arguments

The following argument is valid for this function.

Name Data type Required Description
filepath String Yes This argument is the full file path.

Return values

A Boolean value: true or false.

The function returns true if the file exists. Otherwise, this function returns false.

Description

This function determines whether a file exists or not and returns a Boolean value of true if the file exists.

Example

This example attempts to determine whether the note.txt file exists or not in c:\\.

if ( system.functions.isfileexist(“c:\\note.txt”))
print ("file exist")
else
print ("file doesn't exist");