

ftp <hostname> [<scriptfile>]   (ftnopt mode off)
ftp [<scriptfile>]              (ftnopt mode on)

    The ftp command is used to make a TCP connection with <hostname>, and
    then use File Transfer Protocol to exchange data between the systems.
    Once the connection is established, a small set of commands is used
    to manage the file exchange.  A command is executed locally if it is
    a local client command.  Otherwise, the command is sent to <hostname>
    for execution.  If <scriptfile> is provided, all commands are obtained
    from the indicated file; otherwise, they are read from the console.
    The following are commands supported:

     ?          Display all available command names.

     help       Same as ?

     ascii      Treat the data to be transferred as ASCII text, so that
                line endings are used suitable to the receiving system.

     binary     Treat the data to be transferred as binary data, that is,
                verbatim data not to be changed while storing on the
                receiving system.

     type [a|b|l] Query the current transfer type value, or set it if <a|b|l>
                is given.  Use <ascii>, <binary> (or <image>). <logical 8>
                is also supported.

     reclzw [y|n] Query the state of the ftp client LZW-supported flag,
                or set it if <y|n> is supplied.  LZW compression is only
                supported for ASCII-type transfers.

     sendlzw [y|n] Query the state of the ftp server LZW-supported flag,
                or set it if <y|n> is supplied.  LZW compression is only
                supported for ASCII-type transfers.

     batch [y|n] Query the state of the command batching flag, or set it
                if <y|n> is given.  Batching involves sending as many
                commands as possible before waiting for responses from
                <hostname>.

     hash [y|n] Query the state of the hashmark flag, or set it if <y|n>
                is given.  Hashmarks are written to the screen for each
                1000 bytes written to the local file system.

     verbose [n] Query verbosity of error handler, or set it if integer <n>
                is given.  0 => error msgs only, 1 => final msg only,
                2 => control msgs too, 3 => control msgs + hash marks,
                4 => control msgs + byte counts.

     dir <spec> List the contents of the current directory on the remote
                system, in a verbose manner.  If <spec> is given, the subset
                that matches this file specification is listed.
                    Example:  dir *.exe

     list       Same as dir command.

     ldir <spec> Same as the dir command, but applied to the local system.

     ls spec    List just the names in the current directory on the remote
                system.  If <spec> is given, the subset that matches this
                file specification is listed.
                    Example:  ls *.exe

     nlst       Same as ls command.

     cd path    Change to directory <path> on system <hostname>.

     lcd path   Change to directory <path> on the local system.

     mkdir dir  Create directory <dir> on the remote system.

     lmkdir dir Create directory <dir> on the local system.

     rmdir dir  Delete (remove) directory <dir> on the remote system.

     get file   Transfer <file> from remote system TO the local system.

     mget <spec> Transfer all files matching <spec> from the remote system
                TO the local system.

     view file  Transfer <file> from the remote system TO the local system's
                console screen.  The file is assumed to be an ASCII file!

     resume file Restart an interrupted transfer of <file> from the remote
                system to the local system.  Checks are made to assure the
                file is consistent between systems.  This is a JNOS extension
                to the FTP standard.  Other non-compatible equivalents exist
                in other implementations (c.f. wu-ftpd).

     put file   Transfer <file> to the remote system FROM the local system.

     mput spec  Transfer all files matching <spec> to the remote system
                FROM the local system.

     rput file  Resume an interrupted transfer of <file> to the remote system
                FROM the local system.  Checks are made to assure the
                file is consistent between systems.  This is a JNOS extension
                to the FTP standard.  Other non-compatible equivalents exist
                in other implementations (c.f. wu-ftpd).

     quit       Close the TCP connection to <hostname> and exit the ftp cmd.
                See also the "abort" command.


    Since unrecognized commands are sent to the remote ftp server for
    evaluation, additional commands may be available, depending upon the
    ftp server implementation.  For example, the WU-FTPD may accept site-
    written extensions, and thus allow:  site exec <extended_cmd> <cmd_args>.

    The remote ftp server will require a login name and password.  If
    'ftnopt mode off' is used, these values may be provided by a file
    called "net.rc" by default (see Hostname in nos.cfg).  The file has
    entries in this format:

    remote_hostname   login_name   password

    but the password may be omitted to instead have the client ftp
    prompt for it.

FTN extensions:

    If 'ftnopt mode on' is enabled, the ftp command uses an ftp client
    module modified for FTN operations. Significant changes have been
    made to allow unattended, scripted transfers of Fidonet type mail
    and files. If off, then the normal interactive ftp client module is
    used and the ftn/ftp extensions have no effect. All of the normal
    ftp commands from the interactive module are available from the
    ftn/ftp module.

    The log file format is also modified to output in BinkleyTerm format
    to capture transfer information for inclusion in reports.

    When ftnmode is on, a different command line is used to start an ftp
    session is used. If only 'ftp' is entered, then an interactive
    session is started. If the ftp command line includes a filename,
    then subsequent ftp commands are read and executed from the named
    script file.

    Example: ftp [<scriptfile>]
    

    FTNOPT configuration options:

    (These can be issued from the startup configuration file, secondary
    script files, from the command prompt, from the ftp prompt, or ftp
    script)

        ftnopt dellocal [on|OFF]
            This causes local files to be deleted after successful
            transfers by using the 226 response from the server. It also
            allows local files to be deleted should a receiving transfer
            error occur. (Note: there are some types of transfer
            failures which won't trigger the local deletion.)

        ftnopt delremote [on|OFF]
            This causes remote files to be deleted after successful
            transfers by issuing a DELE <remotefilename> command to the
            ftp server.

    Additional commands added to the FTN ftp client include:

        close

            Used after a prior 'open' command. This closes the current
            ftp connection without exiting the current ftp session. An
            existing connection must be closed prior to opening another.

        detach
            This command has been deactivated in version 1.6c1. Use it
            in the 'onexit.nos' shutdown file, instead.

        exit
            This causes FNOS to exit the ftp client and shut down FNOS
            and exit back to DOS. Be aware that this is primarily
            designed for use when the ftp session is the only one active.
            The results of using the exit command with multiple sessions
            active has not been tested or documented or even encouraged!

        open <aliasname>

            This alias name is used to search the file "ftnalias.lst"
            located in the main FNOS directory to obtain the actual site
            name, login name, and password to use for this connection.
            It can be any alpha/numeric string, although for FTN
            operations, it is suggested that the Fidonet node number
            associated with the session be used.

            Format of the 'ftnalias.lst' file is:

            <aliasname> <sitename> <loginname> <password>

            One alias name per line. Either spaces or tabs can be used
            as delimiters between fields. This alias name is also used
            in the log file as the node number of the connection and is
            displayed on the 2nd status line during session operation.

