Re: uuencode manpage
Bruce Korb <[email protected]> Sat, 11 Sep 2021 09:55:53 -0700
| Newsgroups | gmane.comp.gnu.utils.bugs |
|---|---|
| Message-ID | <[email protected]> |
On 9/11/21 3:18 AM, Davide Brini wrote:
> I think what the OP meant is that in the text of the man page, "-"
> could be used in place of "/dev/stdout" since it works the same and it's
> shorter.
Turns out, that's true. The name there is for the benefit of uudecode
and uudecode does this:
> if ( (strcmp (outname, "/dev/stdout") != 0)
> && (strcmp (outname, "-") != 0) )
> {
> rval = reopen_output (outname, mode);
> if (rval != UUDECODE_EXIT_SUCCESS)
> goto fail_return;
> }
meaning that the strings "/dev/stdout" and "-" are equivalent. I guess
if you want a file named "-", you'll need to use "./-" :)
Who uses this anymore anyway? I've updated the text and someday when
there's a new release it will say:
> @file{uuencode} will read @file{in-file} if provided and otherwise
> read data from standard in and write the encoded form to
> standard out.
> The output will begin with a header line for use by
> @file{uudecode}
> giving it the resulting suggested file @file{output-name} and
> access
> mode. If the @file{output-name} is specifically either
> @file{/dev/stdout} or @file{-}, then @file{uudecode} will emit the
> decoded file to standard out.
I should probably mention that this is an unauthorized extension to
POSIX since "-" is a valid file name character and the official flavor
of uudecode must emit the output into a file so named. deviations are
allowed only if the output name does not come from the official file
name character set. Honoring the "-" as stdout should probably be done
IFF POSIXLY_CORRECT is not set. Assuming sharutils aren't de-POSIX-fied ;)