An Example of Conversions in Action

Crafting complex conversion entries is a task perhaps best left to the Linux/UNIX expert, but the sample ftpconversions file included with wu-ftpd provides more than enough examples for the average administrator. Building your own simple conversion entry is not really too difficult, so let's examine and decode an example:

:.Z: : :/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS

In this example, the strip prefix (field 1) is null because it is not yet implemented, so this rule does not apply to prefixes. The second field of this rule contains the .z postfix; thus it deals with files that have been compressed with the compress utility. The rule does not address the add-on prefix or postfix, so fields 3 and 4 are null. Field 5, the external command field, tells the server to run the compress utility to decompress all files that have the .z extension, as the -d parameter signifies. The -c options tells compress to write the output of the compress utility to the standard out, which is the server in this case. The %s is the name of the file that the rule was applied against. Field 6 specifies that this file is a regular file in ASCII format. Field 7, the options field, tells the server that this command uncompresses the file. Finally, the last field is a comment that gives the administrator a quick decode of what the conversion rule is doing, that is, uncompressing the file.

Was this article helpful?

0 0

Post a comment