Translating Command-Line FTP Instructions

Top  Previous  Next

 

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

  STOR

  PUT

  SENDFILE

  RETR

  GET

  RCVFILE

  CWD

  CD

  FTPCD

  MKD

  MKDIR

  FTPMAKEDIR

  RWD

  RMDIR

  FTPDELDIR

 

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