Displaying Files and Directories on a Remote Server

<< Click to Display Table of Contents >>

Navigation:  Robo-FTP User's Guide > Script Programming > Sample Script Files >

Displaying Files and Directories on a Remote Server

 

The example script file shown below displays the contents of the current directory on the connected remote site.  The names of files are displayed as returned in the %sitefile variable and names of directories are shown using the %sitedir variable.

 

FTPGETREWIND   ;; reset file pointer

GETSITEFILE "*" /incldirs ;; populate variables

:loop

IFSTRCMP %sitefile "" GOTO dir

!DISPLAY %sitefile

!DISPLAY %sitedir

PAUSE /for=5

GOTO next

:dir

IFSTRCMP %sitedir "" GOTO error

!DISPLAY %sitefile

!DISPLAY %sitedir

PAUSE /for=5

:next

GETSITEFILE "*" /next /incldirs   ;; populate variables

IFERROR= $ERROR_NO_FILE_FOUND GOTO finish

IFERROR!= $ERROR_SUCCESS GOTO error

GOTO loop

:error

MESSAGEBOX "This shouldn't ever appear..."

:finish

MESSAGEBOX "All files shown!"

STOP

 

 

Related command(s): FTPGETFILE, FTPLOGON

See also: List of Sample Script Files, Using the %sitedir Variable, Script File Wizard, Script Programming, Script Commands