FileSize (Size of File)

The FileSize function returns the size of a file stored on the datalogger.

Syntax

FileSize ( FileHandle )

OR

Variable = FileSize( FileHandle )

Remarks

The FileHandle parameter specifies the file for which the size should be returned. If FileHandle is a string expression, then it references the location and name of the file. E.g., "Device:FileName" where Device is CPU, CRD (memory card), USR (user-defined drive, or USB (SC115). Else, FileHandle references the return from the FileOpen function.

If the FileSize function fails it will return 0. The function may fail because the file is opened for writing or the file cannot be found.

If FileClose is used to close the file, FileSize must appear prior to FileClose. Once FileClose is executed, the FileHandle no longer exists.

Parameter

FileHandle (File Handle)

The program reference to the file being read from, written to, or otherwise affected by the function. A FileHandle is created by a FileOpen function and deleted by FileClose. Recommended variable type is Long.

Type: Variable