Translating Command-Line FTP Instructions
<< Click to Display Table of Contents >> Navigation: Robo-FTP User's Guide > Script Programming > Select Topics in Script Programming > Translating Command-Line FTP Instructions |
The Unix command line FTP client (and the Windows version which is essentially a clone) were so widely used that it is not unusual for server administrators to provide instructions to clients based on commands for these clients. This can lead to confusion for Robo-FTP users who are trying to decipher these instructions and determine which Robo-FTP script commands to use to achieve the same results.
It is important to understand that commands you type into the Windows or Unix command line client are not raw FTP commands. For example, when you type PUT myfile.txt the command line client translates this into a raw FTP command and actually sends STOR myfile.txt to the server. Robo-FTP has its own set of commands which it translates into raw FTP behind the scenes. For example, to transmit the same raw FTP command STOR myfile.txt to the server with Robo-FTP, you would use SENDFILE "myfile.txt" instead.
The following table shows some common raw FTP commands and their equivalents in the command line client and Robo-FTP.
Raw FTP Verb |
Command-Line Client |
Robo-FTP Command |
Additional Notes |
STOR |
PUT |
||
RETR |
GET |
||
CWD |
CD |
||
MKD |
MKDIR |
||
RWD |
RMDIR |
||
QUIT |
CLOSE |
||
(N/A) |
LCD |
CD or WORKINGDIR |
|
(N/A) |
LITERAL |
||
(N/A) |
OPEN |
||
PWD |
PWD |
||
RETR |
RECV |
||
STOR |
SEND |
||
(N/A) |
TRACE |
||
(N/A) |
VERBOSE |
||
(N/A) |
MDELETE |
||
(N/A) |
MDIR |
||
(N/A) |
MGET |
Most ROBO-FTP commands support wildcards |
|
(N/A) |
MPUT |
Most ROBO-FTP commands support wildcards |
|
(N/A) |
MLS |
Use FTPLIST in a loop to list contents of multiple remote directories |
|
HELP |
REMOTEHELP |
(See notes) |
Use FTPCMD to send 'HELP' to the remote server and %%ftpresultsfile to save the response |
TYPE |
TYPE |
(See notes) |
Use the /type option with the SENDFILE, RCVFILE or SYNC commands |
USER |
USER |
(See notes) |
Use the /user option with the FTPLOGON command |
NLST, LIST |
LS |
(See notes) |
Use FTPLIST to make a text file with remote directory listing |
(N/A) |
GLOB |
(See notes) |
Most ROBO-FTP commands support wildcards |
TYPE |
BINARY |
(See notes) |
Use /type=BIN with the SENDFILE, RCVFILE or SYNC commands |
TYPE |
ASCII |
(See notes) |
Use /type=ASCII with the SENDFILE, RCVFILE or SYNC commands |
(N/A) |
BYE |
||
(N/A) |
QUIT |
Robo-FTP automatically displays useful script translation hints when the user attempts to execute command line FTP client commands in the main console window.
Combining FTP commands
Not all commands have a direct one-to-one relationship. For example, there is no raw FTP command to download multiple files. To download all files matching a certain wildcard pattern with the command line client, you would issue the MGET *.txt command. The command line client processes that command by first retrieving a directory listing (using the raw FTP command NLIST). It then automatically loops over the list of files and uses RETR to download the files one at a time. Robo-FTP scripts would use RCVFILE "*.txt" to achieve the same results.
A second example of combining raw FTP commands is renaming files on-the-fly before uploading.
The command line client supports this syntax: PUT myfile.txt renamed_file.txt. When you enter this command, the client sends the raw FTP command STOR renamed_file.txt, but uploads the contents of myfile.txt -- achieving the appearance of renaming the file on-the-fly. Robo-FTP can achieve the same results using SENDFILE "myfile.txt" /as "renamed_file.txt".
Non-Standard Servers
Robo-FTP and the command-line client will not necessarily send the same sequence of raw commands to the server. The differences, if any, will not impact behavior when connected to a standard server.
Some non-standard servers add functionality by "overloading" raw commands to provide extra instructions to the server. For example, a non-standard server may require additional file meta data to be disguised as folder structures in a "cd" command. We cannot guarantee that Robo-FTP will work with non-standard servers.
See also: List of Script Commands, Script Command Syntax