LISTDIR        List local folder to a file

<< Click to Display Table of Contents >>

Navigation:  Robo-FTP User's Guide > Script Programming > Script Commands > All Script Commands >

LISTDIR        List local folder to a file

Syntax:

LISTDIR

[ dir name ]  [ file name ]

Arguments:

[ dir name ]

Optional variable or string defining a folder path name to list; if no path is defined Robo-FTPs working folder is used.

 

[ file name ]

Optional variable or string defining a file name to write the folder listing to; if no path is defined Robo-FTP writes to a file named "dirlist.txt" in the working folder.

 

 

This script command produces a file containing a folder listing of either Robo-FTP's current local working folder or of the folder specified in the [ dir name ] argument, if specified. When the [ file name ] argument is not specified, Robo-FTP creates a file in the working folder named "dirlist.txt".

 

The folder format written to this file is the same as might be produced using the dir command in a DOS window. Hidden files are not included in the listing but you can use the DOS attrib.exe program to remove the hidden attribute. The user that launched Robo-FTP must have the necessary Windows permissions to actually create the output file.

 

Consider the following example where a listing file of a folder is created and sent to a remote site:

 

LISTDIR "\uploads\*"  

SENDFILE "dirlist.txt"

 

Note: To get a listing of the current directory on a remote site, use the FTPLIST script command.

 

 

Related command(s): FTPLIST, MAKEDIR, WORKINGDIR, WRITEFILE, READFILE