FILECOMPARETO        Compare file size and time/date stamp to FTP site

Top  Previous  Next

Syntax:

FILECOMPARETO

[ file name ]

Arguments:

[ file name ]

Variable or string defining a local file or path name; if no path is defined Robo-FTPs working folder is used.

Options:

/tz=xx

Timezone adjustment (in hours) between the local PC and the FTP site; value is expressed as a positive or negative integer; used when local and server file’s time/date stamps are compared. This value overrides and replaces the timezone adjustment set using the TIMEZONE script command.

 

 

This command is not valid with HTTP/HTTPS sites.

 

This command compares the size and date/time stamp of a specified local file with a file of the same name in the current directory on the FTP site.

 

The results of the comparison are saved in two internal script variables: size result is saved in %comparesize and date/time result is saved in %comparedate. These variables may then be tested using the IFSIZE and IFDATE commands respectively. (Do not use the IFERROR command.)

 

Consider the following example where a specified local file is compared to a correspondingly named file on the FTP site and a conditional branch is taken if the file on the FTP site is larger than the local file.

 

FILECOMPARETO "local_file"

IFSIZE $ERROR_SRVR_FILE_LARGER goto save_this_file

 

If you are not using the TIMEZONE script command, you may specify the /tz option to account for differences in timezones between Robo-FTP and the FTP site. This is important for accurate file date and time stamp comparisons. For example, if you are using Robo-FTP in the Central U.S. timezone and the FTP site is located in the Eastern U.S. timezone there is a one-hour difference between the file system times of Robo-FTP’s PC and the FTP site. To allow for this in the FILECOMPARETO command, the command would look like the following which indicates that the FTP site is one hour ahead:

 

FILECOMPARETO "localfile" /tz=+1

 

Further, if the FTP site is located in the Pacific U.S. timezone there is a two-hour difference the other way between the file system times of Robo-FTP’s PC and the FTP site. To allow for this, the command would look like the following which indicates that the FTP site is two hours behind:

 

FILECOMPARETO "localfile" /tz=-2

 

Related Command(s): IFSIZE, IFDATE, FILECOMPAREFROM

See also: Comparing Local and FTP Site Files