BASIC-DOS

A PCjs Retro-Programming Project

Project maintained by jeffpar

BASIC-DOS Manual

FTP

FTP [host]

Gets files from an FTP server. FTP connects to port 21 of host through the TCP device, the same way FETCH does, displays the server’s greeting, and asks for a user name: press ENTER to log in as anonymous (with guest@ as the password), or type another name, and FTP asks for its password. Then FTP displays its ftp> prompt, and runs each command typed there, displaying every reply from the server (eg, 250 CWD command successful.). With no host, FTP starts at the prompt, and OPEN connects to one.

The commands (in upper or lower case) are:

  • OPEN host: connects to host (closing any connection first) and logs in
  • USER name: logs in again, as name
  • DIR [spec]: lists the files in the server’s current directory (or those matching spec), with their sizes and dates
  • LS [spec]: lists just the names
  • CD dir: changes the server’s current directory (eg, CD /bits/IBM/PC, or CD ..)
  • PWD: displays the server’s current directory
  • GET file [local]: copies file from the server to local, or without local, to a file in the current directory named after file (up to 8 characters before its first ., and 3 after its last, eg, p-system.zip for p-system_rel_1.zip), and displays the number of bytes received
  • BINARY: copies files exactly as they are (the default)
  • ASCII: copies files as text (the server changes their line endings to CR LF)
  • CLOSE: ends the connection
  • QUIT (or BYE): ends the connection and FTP
  • ?: lists the commands

Data is transferred over a second connection, which FTP opens to the address in the server’s reply to PASV (passive mode). FTP can’t send files (there’s no PUT), and any other command, or a command with too many or too few operands, is Invalid command; commands that need a connection are Not connected without one.

ftp.bitsavers.org

The BASIC-DOS network has an FTP server of its own, ftp.bitsavers.org, which serves the files of bitsavers.org, an archive of software and documentation for older computers (eg, /bits/IBM/PC), from bitsavers.org itself. Its files can be read but not changed, and since bitsavers.org is a volunteer project, please get only the files you need. For example:

FTP ftp.bitsavers.org
ftp> cd /bits/IBM/PC/script_pc_1.00
ftp> dir
ftp> get 1502413.ZIP
ftp> quit

Names on ftp.bitsavers.org are found in any case (as they are on a BASIC-DOS disk), and its listings come from bitsavers.org’s own web pages, so a listed file’s size is only approximate (the size in the 150 reply to GET is exact). See FTP Server in the technical reference for how it works.

Errors

FTP displays each failure and continues at its prompt: a reply from the server that isn’t successful (eg, 550 nothere.zip: No such file or directory.), Unable to connect to host, Device timeout, Connection closed (when the server ends the connection), and for GET, the error writing the local file (eg, Disk full or Invalid drive), which ends the transfer (keeping what was received). But if the host on FTP’s command line can’t be reached, FTP displays Unable to connect to host and sets ERRORLEVEL to 68, or Device timeout and 24. A switch (FTP has none) or a second operand is a usage error.

Source: FTP.BAS

Copyright (c) 2020-2026 Jeff Parsons Released under MIT License