Next: , Previous: , Up: ftp: FTP client   [Contents][Index]


11.5 File naming conventions

Files specified as arguments to ftp commands are processed according to the following rules.

  1. If the file name ‘-’ is specified, standard input (for reading) or standard output (for writing) is used.
  2. If the first character of the file name is ‘|’, the remainder of the argument is interpreted as a shell command. ftp then forks a shell, using popen with the argument supplied, and reads/writes from standard input/output. If the shell command includes spaces, the argument must be quoted; e.g. ‘"ls -lt"’.

    A particularly useful example of this mechanism in action, is

    ftp> dir . |less
    

    which allows the user to scroll through a long directory listing.

  3. Failing the above checks, if globbing is enabled, local file names are expanded according to the rules used by csh; c.f. the glob command. If the ftp command expects a single local file (e.g. put), only the first filename generated by the globbing operation is used.
  4. For the commands mget and get with unspecified local file name, the local file name is set to the remote file name, which may be altered by a case, ntrans, or nmap settings. The resulting file name may then be modified if runique is set.
  5. For the commands mput and put with unspecified remote file name, the remote file name is copied from the local file name, which may be altered by a ntrans or nmap settings. The resulting file name may also be modified by the remote server if sunique is set.

Next: File transfer parameters, Previous: Aborting a file transfer, Up: ftp: FTP client   [Contents][Index]