FileStat - return an integer which is the status returned from an open request on the file

Return to Introduction  Previous page  Next page

$return = FileStat(filename,mode)

Where:

$returnis the integer return code for one of the following standard Windows file exceptions:
0 = none. No error occurred.
1 = genericException. An unspecified error occurred.
2 = fileNotFound. The file could not be located.
3 = badPath. All or part of the path is invalid.
4 = tooManyOpenFiles. The permitted number of open files was exceeded.
5 = accessDenied. The file could not be accessed.
6 = invalidFile. There was an attempt to use an invalid file handle.
7 = removeCurrentDir. The current working directory cannot be removed.
8 = directoryFull. There are no more directory entries.
9 = badSeek. There was an error trying to set the file pointer.
10 = hardIO. There was a hardware error.
11 = sharingViolation. SHARE.EXE was not loaded, or a shared region was locked.
12 = lockViolation. There was an attempt to lock a region that was already locked.
13 = diskFull. The disk is full.
14 = endOfFile. The end of file was reached.
 
filenameis the full filename, including drive letter and path name for the file.        
modeis the mode of the open request. It must be one of the following.
modeRead
modeWrite
modeReadWrite

 

path and mode may be a variables.

The FileStat command returns the status from an open request to a disk file.

 

Examples

       If FileStat("D:\test.txt",modeRead) = 2 Then GoTo FileNotFound:
       If FileStat("D:\test.txt",modeWrite) = 11 Then GoTo FileAlreadyOpen:

 

See Also:

 

Script Command Summary

Script Variables

Using the Scripting Language


TN3270 Plus is continually being improved. To learn more about the latest enhancements, please review our Version History web page.