test_ftpd syntax

Purpose

The ftpd program is a daemon that provides the server-side implementation of the FTP protocol. It enables you to communicate with a Symbian platform device from your remote PC using an FTP client.

Syntax

> test_ftpd [-DlP]

The following table provides a brief description of the options:

OptionDescription

-D

Starts the FTP service in the background and returns control to the prompt.

-l

Logs all FTP commands for debugging purpose.

-P

Specifies the port number on which the FTP service must listen.

FTP commands

The ftpd daemon supports the following FTP commands:

OptionDescription

CWD

Used to change the current working directory. For example, the following command changes the current working directory to bin:

> cwd bin

LIST

Used to list information about a given file or about the files and subdirectories of a given directory. By default, it lists information about the files and subdirectories in the current directory. Before using this command, you must either use PORT or PASV command to indicate that the server must send the data.

DELE

Used to delete the specified file from the current working directory. You can specify the filename using either the relative path or the absolute path. For example, the following command deletes the log.txt file from the current working directory:

> DELE log.txt

MKD

Used to create a new directory under the current working directory.

MODE

Used to set the file transfer mode to ASCII or BINARY. The following command changes the file transfer mode to ASCII:

> MODE ASCII

NLST

Used to list the names of all the files in a specified directory.

PASS

Used to authenticate the password for the current user ID. Before specifying the password to be authenticated, you must specify the user ID using the USER command.

PASV

Used to instruct the FTP server to enter the passive mode. When the server enters the passive mode successfully, the IP address and the port number on which the server is listening are displayed on the console.

PORT

Used to specify the IP address and port number of the host to which the daemon must connect for the next file transfer. For example, the following command specifies the IP address and port number of the host:

> PORT 172,0,0,1,0,21

As per the earlier command, the daemon must connect to the host with the specified IP address (172.0.0.1) and port number (21) for the next file transfer.

PWD

Used to print the current working directory to the console.

QUIT

Used to terminate the FTP session.

RETR

Used to retrieve the specified file from the host to the PC. Before using this command, you must use either the PORT or PASV command to indicate that the server must send the data.

RMD

Used to delete the specified directory from the host. This command works only if the directory is empty.

RNFR

Used to rename a file. Specify the file to be renamed using this command, and the new name with the RNTO command. For example, the following commands rename the file, log.txt to sys_log.txt:

> RNFR log.txt | RNTO sys_log.txt

Note: You can refer to the files using either their absolute path or relative path. The earlier file rename example can be changed as follows:

> RNFR log.txt | RNTO /C/folder1/sys_log.txt

RNTO

Used with RNFR to rename a file.

STOR

Used to transfer the specified file from the PC to the host. Before using this command, you must either use PORT or PASV command to indicate that the server must send the data.

USER

Used to begin the login process by specifying the user ID, followed by the password using the PASS command. The user ID must be valid on the host.

Note: The commands listed in the table earlier may not be same as the commands supported by the FTP client you are using. For information about the commands supported by the FTP client you are using, refer to its documentation.