[comp.sys.amiga.programmer] UUencode

Marcus@cup.portal.com (Mark W Shnayer) (02/11/91)

A simple question, hopefully there is a simple answer. 
I am tryingto uuencode a file and cant seem to get the syntax right.
For example, to uuencode a file called 'game'.

UUENCODE game game.u
or
UUENCODE game >game.u

both result in the uuencoded file showing in the CLI I am using to do the
job but no file actually gets created.

Assuming the file 'game' is in ram: and I want to uuencode to ram:
whats the right way to do this?
Marcus@cup.portal.com

dave@cs.arizona.edu (Dave P. Schaumann) (02/11/91)

In article <39115@cup.portal.com> Marcus@cup.portal.com (Mark W Shnayer) writes:
>I am tryingto uuencode a file and cant seem to get the syntax right.
>[...]
>UUENCODE game game.u
>or
>UUENCODE game >game.u

For some unknown reason (at least to me :), both the CLI and the Shell require
that file redirection be the first arguments on the line after the program
name.  Try "UUENCODE >game.u game".

>Marcus@cup.portal.com

-- 
Dave Schaumann      | DANGER: Access holes may tear easily.  Use of the access
		    | holes for lifting or carrying may result in damage to the
dave@cs.arizona.edu | carton and subsequent injury to the user.

greg@ccwf.cc.utexas.edu (Greg Harp) (02/11/91)

In article <833@caslon.cs.arizona.edu> dave@cs.arizona.edu (Dave P. Schaumann) 
  writes:
>In article <39115@cup.portal.com> Marcus@cup.portal.com (Mark W Shnayer) writes:
>>I am tryingto uuencode a file and cant seem to get the syntax right.
>>[...]
>>UUENCODE game game.u
>>or
>>UUENCODE game >game.u
>
>For some unknown reason (at least to me :), both the CLI and the Shell require
>that file redirection be the first arguments on the line after the program
>name.  Try "UUENCODE >game.u game".

I just tried the Amiga version of UUencode on my system and here is how I
did it.

RAM DISK:> uuencode <s:shell-startup >shell-startup.uue shell-startup

This produced the file 'shell-startup.uue' which I then putfiles-ed (using
DNet -- Thanks Matt!) to the SPARC I'm using.  The file properly uudecoded
without a hitch.  The protection bits apparently default to octal 644.

BTW, Unix uuencode works a bit differently.  To uuencode the same file,
I would type:

pooh.cc.utexas.edu% uuencode shell-startup shell-startup >shell-startup.uue

In this case, the protection bits are inherited from the file.

Hope this helps!

Greg
-- 
------------------------------------------------------------------------------
"I don't know what it is I like about you, but I like it a lot." --
                                         Led Zeppelin, Communication Breakdown
-------Greg-Harp-------greg@ccwf.cc.utexas.edu-------s609@cs.utexas.edu-------

guineau@wjg.enet.dec.com (W. John Guineau) (02/11/91)

In article <39115@cup.portal.com>, Marcus@cup.portal.com (Mark W Shnayer) writes...
>A simple question, hopefully there is a simple answer. 
>I am tryingto uuencode a file and cant seem to get the syntax right.
>For example, to uuencode a file called 'game'.
> 
>UUENCODE game game.u
>or
>UUENCODE game >game.u
> 


uuencode name-in-uuencoded-file <real-file >uuencoded-file

ex:

to uuencode game.lzh:

	uuencode game.lzh <game.lzh >game.lzh.UU

the first parameter is what uuencode sticks in the uuencoded file 
as the name to uudecode it as. This can be anything, but should reflect
what the file is :-)

uuencode then reads stdin, uuencodes, and writes to stdout.

>Marcus@cup.portal.com


--                			
W. John Guineau                         grep meaning life | more
Digital Equipment Corporation		
guineau@wjg.enet.dec.com   or   wjg@wpi.wpi.edu

jms@vanth.UUCP (Jim Shaffer) (02/12/91)

In article <39115@cup.portal.com> Marcus@cup.portal.com (Mark W Shnayer) writes:
>A simple question, hopefully there is a simple answer.
>I am tryingto uuencode a file and cant seem to get the syntax right.
>For example, to uuencode a file called 'game'.
>
>UUENCODE game >game.u

Try UUENCODE >game.u game

(Yes, I HATE IT TOO!  Why can't AmigaDOS let you put the redirection LAST
like on Unix?)

--
~  From the disk of:  | jms@vanth.uucp		     | "Glittering prizes and
Jim Shaffer, Jr.      | amix.commodore.com!vanth!jms | endless compromises
37 Brook Street       | 72750.2335@compuserve.com    | shatter the illusion of
Montgomery, PA 17752  | (CompuServe as a last resort)| integrity!"  (Rush)

Marcus@cup.portal.com (Mark W Shnayer) (02/12/91)

Thanx for all the quick responses to my UUENCODE question. My docs were
for the UNIX version, so those left/right arrows weren't documented and
I was left very confused.

The right syntax is...

to uuencode game.lzh:

        uuencode game.lzh <game.lzh >game.lzh.UU

Worked perfectly

Marcus@cup.portal.com

ug@linkoping.telesoft.se (Ulf G|ransson) (02/12/91)

In article <39115@cup.portal.com> Marcus@cup.portal.com (Mark W Shnayer) writes:
...
>UUENCODE game game.u
>or
>UUENCODE game >game.u
>
>both result in the uuencoded file showing in the CLI I am using to do the
>job but no file actually gets created.
>
>Assuming the file 'game' is in ram: and I want to uuencode to ram:
>whats the right way to do this?
>Marcus@cup.portal.com

The syntax for uuencode is

 uuencode [ source-file ] file-label

and the output goes to stdout. If source-file is left out, stdin is read.
This, and the fact that the CLI wants all redirections before the
options give the following command lines:

 uuencode >ram:game.u ram:game game
or perhaps
 uuencode <ram:game >ram:game.u game

The file-label is used to tell uudecode what the file name of the
new file should be.
-- 
Ulf Goransson, Telesoft Europe AB         (ug@linkoping.telesoft.se)

And now for something completely different.

lhotka@incstar.uucp (02/13/91)

In article <39144@cup.portal.com>, Marcus@cup.portal.com (Mark W Shnayer) writes:
> Thanx for all the quick responses to my UUENCODE question. My docs were
> for the UNIX version, so those left/right arrows weren't documented and
> I was left very confused.
> 
> The right syntax is...
> 
> to uuencode game.lzh:
> 
>         uuencode game.lzh <game.lzh >game.lzh.UU
> 
> Worked perfectly
> 
> Marcus@cup.portal.com

This appears to be incorrect but works on my Amiga, a BSD machine
and VAX/VMS:

	uuencode game.lzh game.lzh

You end up with game.uue and the uudecode works fine afterwords.
All this without redirection...  What a deal huh?!?!  I assume
it can't be too much wrong when it works on three different machines,
but then again... :-)
 ______________________________________________________________________
/ Rockford Lhotka				INCSTAR Corp	       \
| Applications Project Leader			1990 Industrial Blvd   |
| incstar!lhotka@uunet.uu.net         		PO Box 285             |
\ 612/779-1701					Stillwater, MN 55082   /
 -------------Amiga - The computer for the creative mind.--------------

Marcus@cup.portal.com (Mark W Shnayer) (02/14/91)

Thanx to all the people who replied both in e-mail and public.
The response was overwhelming! Over 30 in my mailbox alone!
I now know how to uuencode properly and have just come up with an idea 
finally to put my poor programming abilities into.

A nice requestor driven utility so all I have to do is click on the
file in the requestor and TA-DA!, it uuencodes the file appending the
.UU suffix to the uuencoded file thus created.

I have the source code to uuencode/uudecode so I have something to try
to put together than just another 'yet yet another clock util'.

 
Marcus@cup.portal.com