FTPGETFILE         Get file from directory structure on FTP site

Top  Previous  Next

Syntax:

FTPGETFILE

[ file name ] [ /options ]

Arguments:

[ file name ]

Variable or string defining a file name to look for; wildcard characters are allowed; this should be a file name only (do not include a directory name).

Options:

/ignorecase

Test for file name matches after forcing the local and site files to be lower case effectively making the match case-insensitive.

 

/incldirs

Return FTP site directory name(s) as they are found.

 

/newest

Get the newest file in the directory tree.

 

/oldest

Get the oldest file in the directory tree.

 

/timeout=nn

Time-out in seconds to wait for presence of the file; if this option is omitted, Robo-FTP looks for the file and if nothing is found, $ERROR_NO_FILE_FOUND is returned; otherwise $ERROR_WAIT_TIMED_OUT is returned.

 

 

This command is not valid with HTTP/HTTPS sites.

 

This script command checks for (and optionally waits for) the existence of a file defined by the [ file name ] argument within the current directory on an FTP site. If a matching file is detected, the file name is saved in the %sitefile variable. The date and time of the file or directory are also saved in the %sitefiledate, %sitefiledatetime, and %sitefiletime variables. The size of the file, in bytes, is saved in the %sitefilesize variable.

 

This command is functionally equivalent to the GETSITEFILE script command except for two important differences.

 

FTPGETFILE has the capability to decend into and out of subdirectories that it finds within a given directory tree on the FTP site (assuming the /incldirs option is specified) while GETSITEFILE does not. (GETSITEFILE returns directory names it finds in the %sitedir script variable instead.)

 

Secondly, FTPGETFILE does away with the /next option. FTPGETFILE will always return the next file found when called repeatedly on the same site directory structure when there are wildcard character(s) in [ file name ]. In the event that you wish to start over with the first matching file in the folder structure, issue the FTPGETREWIND command and then resume issuing FTPGETFILE.

 

Otherwise refer to the description of GETSITEFILE for more details on this command.

Related Commands: FTPGETREWIND