PMDF User's Guide
UNIX Edition


Previous Next Contents Index


decode

Decodes a file which was previously encoded with the pmdf encode utility or encoded using a MIME aware mail agent.

restrictions

None.

Syntax

pmdf decode encoded-file-spec output-file-spec

Qualifiers Defaults
-encoding=type -encoding=base64
-filename -nofilename
-header -header

prompts

Input file: encoded-file-spec
Output file: output-file-spec

Parameters

encoded-file-spec

Specifies the name of an encoded input file. The input file must be a file previously encoded, for example with the pmdf encode utility.

output-file-spec

The name of the file to produce as output. The file output by pmdf decode will have the identical format, structure, contents, etc. of the original file encoded with pmdf encode. When the -filename qualifier is used, the output-file-spec is treated as a default file specification and as much as possible of the file name, if any, specified in the Content-type: header line is used to generate the actual output file name.

Description

pmdf decode and pmdf encode have been, for the most part, made obsolete by MIME-aware mail user agents, e.g., Pine. If you use Pine or another MIME-aware mail user agent, then files which you send with the Send command will be encoded automatically, if necessary. Encoded messages which you receive will be decoded automatically, if necessary, and may simply be extracted to a file with the regular extract command. If, however, you do not use pine or another MIME aware mail user agent, then read on.

The pmdf encode and pmdf decode utilities are provided with PMDF as a means of transmitting binary files via non-MIME aware agents. With pmdf encode, a file may be encoded in a format which uses short records containing only printable characters. Such files can then be transmitted through most any mail system without being altered (e.g., lines wrapped, characters removed or replaced, etc.). pmdf encode preserves all file contents and all file attributes when encoding a file. The contents and attributes are properly restored when decoded with pmdf decode. Absolutely any type of binary file can be transmitted with these two utilities.

Encoded files have two parts. The first part is a conventional RFC 822 message header. Header lines are used to describe the file format; this information includes a description of the encoding used to convert the file into a printable form for transfer. pmdf encode creates this header; pmdf decode reads it and uses the information it contains to reconstruct the file.

Note

Many encoded messages received with PMDF are decoded automatically for you, thus obviating the need to use pmdf decode at all. This is especially true when you use pine whose Save command will extract any MIME-encoded message or message body part. If you use mail, however, you may occasionally receive an encoded message which PMDF could not deliver in its decoded form owing to limitations of mail itself.

Qualifiers

-encoding=type

This qualifier controls the type of decoding used to decode the input file. The possible values for this qualifier are BASE64, CBASE64 (gzip compressed BASE64), BASE85, BINHEX (encoding only, not the file format), BTOA, HEXADECIMAL, QUOTED_PRINTABLE, UUENCODE, CUUENCODE (gzip compressed UUENCODE). It should not be necessary to specify the encoding used; this should be given in the message header. This qualifier will override the header specification if it is used.

-filename

-nofilename (default)

When the -filename qualifier is used, the output-file-spec is treated as a default file specification and as much as possible of the file name, if any, specified in the Content-type: header line is used to generate the actual output file name. The default is -nofilename in which case any file name specified in the Content-type: header line is ignored.

-header (default)

-noheader

This qualifier controls whether or not the encoded file begins with a MIME-compliant header. -header is the default. -noheader is used to force PMDF to read material that was not encoded by a MIME messaging system. When -noheader is used the -encoding qualifier is usually needed to specify the encoding since it cannot be determined from the header.

EXAMPLES

The following example illustrates a typical scenario: sue@college.edu wants to send an executable program to bob@example.com. To do this, Sue might issue the following two commands:


% pmdf encode program program.txt
% pmdf send -subject=\"Bob, here\'s the program\" program.txt bob@example.com
When Bob receives this mail message he should issue the following commands:


% mail
...extract the message...
% ! Remove any extra material at the beginning and ending of the file. 
% pmdf decode program.txt program
After decoding the file, Bob may now proceed to run program.

Note that Sue could also have used Pine to send the file, bypassing the need to use pmdf encode in the first place. See the context sensitive help within Pine for help on sending files from Pine.


Previous Next Contents Index