386BSD 0.1 development
[unix-history] / usr / src / usr.bin / uuencode / uuencode.format.5
CommitLineData
19f82df4
WJ
1.\" Copyright (c) 1989, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)uuencode.format.5 6.4 (Berkeley) 5/10/91
33.\"
34.Dd May 10, 1991
35.Dt UUENCODE 5
36.Os BSD 4.0
37.Sh NAME
38.Nm uuencode
39.Nd format of an encoded uuencode file
40.Sh DESCRIPTION
41Files output by
42.Xr uuencode 1
43consist of a header line,
44followed by a number of body lines,
45and a trailer line.
46The
47.Xr uudecode 1
48command
49will ignore any lines preceding the header or
50following the trailer.
51Lines preceding a header must not, of course,
52look like a header.
53.Pp
54The header line is distinguished by having the first
556 characters
56.Dq begin\ \&
57The word
58.Em begin
59is followed by a mode (in octal),
60and a string which names the remote file.
61A space separates the three items in the header line.
62.Pp
63The body consists of a number of lines, each at most 62 characters
64long (including the trailing newline).
65These consist of a character count,
66followed by encoded characters,
67followed by a newline.
68The character count is a single printing character,
69and represents an integer, the number of bytes
70the rest of the line represents.
71Such integers are always in the range from 0 to 63 and can
72be determined by subtracting the character space (octal 40)
73from the character.
74.Pp
75Groups of 3 bytes are stored in 4 characters, 6 bits per character.
76All are offset by a space to make the characters printing.
77The last line may be shorter than the normal 45 bytes.
78If the size is not a multiple of 3, this fact can be determined
79by the value of the count on the last line.
80Extra garbage will be included to make the character count a multiple
81of 4.
82The body is terminated by a line with a count of zero.
83This line consists of one
84.Tn ASCII
85space.
86.Pp
87The trailer line consists of
88.Dq end
89on a line by itself.
90.Sh SEE ALSO
91.Xr uuencode 1 ,
92.Xr uudecode 1 ,
93.Xr uusend 1 ,
94.Xr uucp 1 ,
95.Xr mail 1
96.Sh HISTORY
97The
98.Nm
99file format appeared in
100.Bx 4.0 .
101.\" It was named uuencode.5 prior to 4.3