mTCP FTP logo

A nice little DOS FTP Client for IBM PCs, XTs PCjrs and slightly newer machines


Introduction

This is an FTP client like many other FTP clients you have probably used before. Features include fairly high performance, low memory requirements, and compatibility with a wide selection of FTP clients.

Hardware requirements

8088 processor or better
Somewhere between 130KB and 180KB available RAM
Display: doesn't matter, whatever you have
Supported Ethernet card

Software requirements

DOS 2.0 or newer (DOS 3.3 or newer recommended)
Packet driver for your Ethernet card

Setup

FTP is built using the mTCP library. The setup instructions for mTCP can be found in SETUP.TXT.

Using FTP

FTP uses the following syntax:

ftp [-port <n>] <ftp_server_addr>

Options are:

-help     Show basic help text
-port <n>     Connect using port <n> instead of port 21


You have to specify the ftp server address on the command line. After the control socket is opened you will be prompted for a user ID and password. After that you get a command line just like on other FTP command line clients.

Here are some of the commands:

dir     directory list (full details)
ls     directory list (names only)
cd     change to a directory
cdup     move up one directory
lcd change local directory
pwd     print current working directory
ascii     Set transfer type to 'ASCII'
image     Set transfer type to 'image' or 'binary'
get     Get a file
put     Send a file
mget Get multiple files
mput Put multiple files
prompt Toggle mget/mput prompting on or off
delete     Delete afile
mkdir     Make directory
rmdir     Remove directory
rename rename a file on the server
quote     Send a command to the FTP server directly
quit     Quit
shell     Shell to DOS
xfermode     Set default transfer mode - see section below


The program captures Ctrl-Break and Ctrl-C. If you use Ctrl-Break during a file transfer or directory listing the current operation will stop (prematurely) and you will be returned to the command line after a brief delay. If you use Ctrl-Break or Ctrl-C at the command line the program will end.

The shell command should be used with care. With the shell command you can do local directory listings, rename local files, look inside of files, and do most normal things. Keep in mind that while you are at the DOS command prompt the mTCP code is not servicing the socket connection - if you stay in DOS too long you might lose your connection to the FTP server.

Transfer modes

The xfer mode command requires a little explanation.

In the beginning of time FTP servers always sent data by doing a connect to the FTP client, which was listening for the incoming connection on a default port. The FTP server in NCSA telnet does this. I'll call this 'Classic' mode and you can tell this FTP client to handle data transfers this way.

'Classic' mode is only useful for ancient FTP servers that can't do anything else. Most modern FTP servers will not connect to an FTP client on the default ports, and most firewalls/routers wouldn't allow it anyway.

'Port' mode is the current default for many clients. Instead of having the FTP server connect to the client on default ports, the client will tell the FTP server exactly what port it should use for the connection. This is slightly better than Classic mode, and should be usable on more FTP servers, firewalls and routers.

'Passive' mode is probably the best and most compatible mode to use with modern FTP servers. It turns things around by making the client connect to the FTP server to make data connections instead of having the FTP server connect to the client. (From the standpoint of the FTP server it is 'passive' and it waits for a connection from the client.) This will work with almost any firewall and router. This is the mode I'd recommend using too.

Advanced Configuration Parameters

The default timeout for a socket connect is something around 10 seconds. If this is too short you can change it by adding a line to your mTCP configuration file. The parameter to set is called FTP_CONNECT_TIMEOUT. For example:

FTP_CONNECT_TIMEOUT 15

will raise the timeout to 15 seconds.

Environment variables

Three environment variables are provided to help tailor ftp to your memory and performance requirements.

TCPRCVBUF

Default 8192, Range 512 to 16384

Use: Sets the size of the receive buffer that TCP/IP sets up for a socket connection. Bigger numbers generally result in higher performance. Use a smaller number if you are tight on memory and need to cut back on what FTP wants to use.

If you are low on memory 4KB is a reasonable setting that will not hurt performance too much.

FILEBUF

Default 8192, Range 512 to 32768

Use: Sets the size of the buffer used to read and write files on your local disk. Bigger numbers generally result in higher performance. Use a smaller number if you are tight on memory and need to cut back on what FTP wants to use.

If you are low on memory 4KB is a reasonable setting that will not hurt performance too much.

MLISTBUF

Default: 2048, Range 512 to 4096

Use: Sets the size of the buffer used to hold the list of files that mget and mput will use.

Performance

Performance depends on your hardware, but here are some rough observations:


Download!

Ftp is included with the other mTCP based applications. They can be downloaded from the main mTCP page here.

Changes

2009-01-18:
2009-04-15:
2009-04-26:


Created January 18th, 2009, Last updated September 25th, 2009
(C)opyright Michael B. Brutman, mbbrutman@yahoo.com