File.ComputeLength Function

Reads a file and computes the length of a file by reading through all the data in the file.

<integer_variable>= File.ComputeLength ( path )

Prerequisites

None

Parameters

path

A required String expression that contains the path to the file that is to be read.

Remarks

This function permits a GPL program to detect if a file has been changed or corrupted by computing its length so that it can be compared with the length in the file directory.

If the lengths match, the disk file allocation table is likely valid, but there is no guarantee that the actual data is unmodified.

Examples

Dim len As Integer
len = File.ComputeLength(path)
Console.Writeline("Computed length is " & CStr(len))

See Also

File and Serial I/O | File.ComputeCRC | File.Length