Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Declined Enhanced file comparisons

May
3,515
5
1/ Size and content comparison
A new function @COMPAREX[] would return the numeric values shown below
if both files are accessible, but would report accessibility problems
through its return value instead of reporting a system error on STDERR:
return condition
-3 neither file is accessible
-2 file 1 accessible, file 2 not accessible
-1 file 1 not accessible, file 2 accessible
0 both files accessible and have identical sizes and contents
1 both files accessible, but file 1 larger, hence contents different
2 both files accessible, but file 2 larger, hence contents different
3 both files accessible, and have identical sizes, but contents are
different

2/ Age comparison
A new function which would compare the ages of two files, returning
numeric values as follows:
return condition
-3 neither file 1 nor file 2 exists
-2 file 1 exists, file 2 does not exist
-1 file 1 does not exist, file 2 exists
0 both files exist and have the same age
1 both files exist and file 1 is older
2 both files exist and file 2 is older

I could also utilize a function which combines the two functions above
using additional return codes for each possible combination, e.g. by adding
4 or 8 to the first function's value if file 1 or file 2 is older, resp.
Value 0 would mean same age and content...

All of these functions would serve the user in the maintenance of
multiple file systems, backing up or updating, in MAKE type operations, etc.
--
Steve
 

Similar threads

Back
Top