Displaying Files and Directories on an FTP Site

Top  Previous  Next

 

The example script file shown below starts with the first file or subdirectory in the current  FTP site directory and traces the contents of the directory displaying the names of files (as returned in the %sitefile variable) and name of directories (as returned in the %sitedir variable).

 

GETSITEFILE "*.*" /subdirs

: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 /subdirs

IFERROR= $ERROR_NO_FILE_FOUND goto finish

GOTO loop

:error

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

:finish

MESSAGEBOX "Shown all files!"