Logical Files

CompareFiles

STD.File.CompareFiles( lfn1, lfn2, logical_only, use_crcs )

lfn1A null-terminated string containing the logical name of the first file.
lfn2A null-terminated string containing the logical name of the second file.
logical_onlyOptional. A boolean TRUE/FALSE flag that, when TRUE, does not compare physical information from disk but only the logical information in the system datastore (Dali). If omitted, the default is TRUE.
use_crcsOptional. A boolean TRUE/FALSE flag indicating that, when TRUE, compares physical CRCs of all the parts on disk. This may be slow on large files. If omitted, the default is FALSE.
Return: CompareFiles returns returns an INTEGER4 value.

The CompareFiles function compares file1 against file2 and returns the following values:

0file1 and file2 match exactly
1file1 and file2 contents match, but file1 is newer than file2
-1file1 and file2 contents match, but file2 is newer than file1
2file1 and file2 contents do not match and file1 is newer than file2
-2file1 and file2 contents do not match and file2 is newer than file1

Example:

A := STD.File.CompareFiles('Fred1', 'Fred2');