Logical Files

CompareFiles

STD.File.CompareFiles( file1, file2 [ , logicalonly ] [ , usecrcs ] )

file1A null-terminated string containing the logical name of the first file.
file2A null-terminated string containing the logical name of the second file.
logicalonlyOptional. 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.
usecrcsOptional. 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');