Salesforce

How Do I Check if a File Exists on Disk? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Check if a File Exists on Disk? (Magic xpa 3.x)

One common function you need is to check if a file exists on disk. For instance, if a user was dumping records to be read into Excel, you might want to give a message if no records were found or the process was unsuccessful for some other reason.

It is always better to use the Magic xpa functions rather than using an exit to the operating system. Using an exit to the operating system is very dependent on the version of the operating system and how the user is set up; the Magic xpa functions are far more reliable. Also, the Magic xpa functions allow you to check return codes more easily.

FileExist()

You can determine whether or not a file exists using the FileExist() function. The syntax is:

FileExist(File Name)

Where File Name is the name of the file you are looking for. It returns true if the file is found.

See also

The Magic xpa Help for I/O functions

The Online and Rich Client Samples projects (program EL17, REL17 and REL17b)

Reference
Attachment 
Attachment