ftpconv(SFF)
ftpconv --
ftpd conversions database
Format
%s:%s:%s:%s:%s:%s:%s:%s
1 2 3 4 5 6 7 8
Field Description
1 strip prefix
2 strip postfix
3 addon prefix
4 addon postfix
5 external command
6 types
7 options
8 description
Description
The conversions known by
ftpd(ADMN)
and their attributes are stored in an ASCII file
that is structured as shown in the ``Format'' section.
Each line in the file provides a description for a single
conversion. Fields are separated by colons (:).
Prefix and postfix
The prefix fields are not currently used. The postfix
fields define extensions to be added or removed from
user-specified filenames. The ``addon postfix'' field is
assumed to have been appended to a real filename and is
removed prior to looking up the file. The ``strip
postfix'' field is appended to the user-supplied filename
prior to looking up the file. This is somewhat
counter-intuitive.
The file name that results is available for use in the
``external command'' field by using the special string
``%s''.
Types
The following types are defined:
T_ASCII-
ASCII files
T_DIR-
directories
T_REG-
regular files.
A type specification indicates that only files of the
specified type are allowed to be converted. This is used
to prevent transferring of compressed files in binary mode
or attempts to compress directories.
More than one type may be specified by separating them with
the ``|'' character.
Options
Some built-in options are known to the FTP server
and will cause special information to be displayed in the
log file (see
ftplog(SFF))
if transfers are being logged. These are:
O_COMPRESS-
the file was compressed during transfer
O_TAR-
the file was tar'd during transfer
O_UNCOMPRESS-
the file was uncompressed during transfer.
More than one option may be specified by separating them
with the ``|'' character.
Example
The following example shows a conversion that causes files
whose names end in ``.tar'' to have their suffix removed.
The resulting filename is used as an argument to the
tar(C)
command. The transfer is not allowed to be performed in
ASCII mode and a special ``tar'' flag will be
written to the transfer log.
: : :.tar:/usr/bin/tar cf - %s:T_REG|T_DIR:O_TAR:TAR
A typical conversions file might look like this:
#
#strip prefix:strip postfix:addon prefix:addon postfix:external command:
#types:options:description
:.Z: : :/usr/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
:.gz: : :/usr/bin/gzip -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
:.bz2: : :/usr/bin/bzip2 -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
:-z: : :/usr/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
: : :.Z:/usr/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS
: : :.gz:/usr/bin/gzip -9 -c %s:T_REG:O_COMPRESS:COMPRESS
: : :.bz2:/usr/bin/bzip2 -9 -c %s:T_REG:O_COMPRESS:COMPRESS
: : :.tar:/usr/bin/tar crf - %s:T_REG|T_DIR:O_TAR:TAR
: : :.tar.Z:/bin/sh -c '/usr/bin/tar crf - %s | /usr/bin/compress':T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPRESS
: : :.tar.gz:/bin/sh -c '/usr/bin/tar crf - %s | /usr/bin/gzip -9':T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPRESS
: : :.tar.bz2:/bin/sh -c '/usr/bin/tar crf - %s | /usr/bin/bzip2 -9':T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPRESS
Notes
A copy of every program mentioned in the conversions file must be
included under the ftp home directory (typically noted as
~ftp/).
For example, if you use /usr/bin/compress in the conversions file,
then a copy of the compress command must be placed under
~ftp/usr/bin/.
Files
/etc/ftpconv
See also
ftpd(ADMN),
ftpaccess(SFF),
ftplog(SFF)
© 2007 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 05 June 2007