FileExist

Parent Previous Next

FileExist

Function that will return a boolean value indicating if the file passed in the parameter exists or not.


Syntax

Boolean fileExists(String pathName);
Verify if the file passed in the parameter exists.


Params:

String pathName: A String parameter containing the full path name of the file including the file name and the extension.


Return

True: The file exists.

False: The file not exists.


Example

In this example, we are checking if the file "OpenFunction.txt" located in the path "C:\" exists. If the file exists the user will write a positive message in the Engineering Log and if it fails the user will write a negative message in the Engineering Log.

  


@FileExists = SVFile.fileExists("C:\OpenFunction.txt");

if(@FileExists == true )

SVApplications.Output("File Exists");

else

SVApplications.Output("File not exists");