Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!uvaarpa!mcnc!rti!sunpix!matthew From: matthew@sunpix.UUCP ( Sun Visualization Products) Newsgroups: comp.sys.amiga.tech Subject: Re: UUDECODE info. requested...what is first line? Keywords: begin ### filename Message-ID: <933@greens.UUCP> Date: 20 Oct 89 11:42:47 GMT References: <557@isi.UUCP> Reply-To: matthew@greens.UUCP (Matthew Stier - Sun Visualization Products) Organization: Sun Microsystems, RTP, NC Lines: 70 In article <557@isi.UUCP> mark@isi.UUCP (Mark Bailey) writes: }I have finally gotten around to writing UUDECODE on the local UNIX box. } }Question: the amiga shar files I'm getting spit out a line like } }begin 644 name } }in front of all UUENCODED files. I can get around this but was }wondering if someone could e-mail me the official explanation and rules }for this line. Should my UUENCODE generate one? Should I strip it }before UUDECODING? } }Thank you very much. This may be a re-post (our machine died and I }never got any response the first time!!!) } }-- }Mark Bailey (I didn't really say this.) }via: ...!uunet!pyrdc!isi!mark ------Have a 8-| day!!!!! The purpose of the 'begin 644 name' line is to give uudecode a starting point to work from. With this line uudecode will know several things. 1) What line the uuencoded information actually begins. In this way, a uudecode program can be written that can do self striping of mail and other headers. (ever notice that uudecode can take entire e-mail messages and find what it needs. No preprocessing to remove the file header needed.) /* here is some off the cuff code to show you how to find the begin line */ do { buf=read(); } until(strncmp(buf,"begin ",6)) 2) The number (in your case 644) is the unix read/write/execute permissions of the encoded file. If you are uudecodeing the number can typically be ignored. If you are creating uuencodeing files on a non-unix system, 644 is a good default to use. The number are octal values with the following conventions: The first digit is users permission (6) /* the single users */ The second digit is group permissions (4) /* a group of users */ The third digit is world permissions (4) /* everybody */ The digits themselves are decoded as: Most significant bit is read. The middle bit is write. Least significant bit is execute. So the following codes mean: 7) Read, write and execute permissions. 6) Read and write permissions. 5) Read and execute permissions. 4) Read permission only. 3) Write and execute permissions. 2) Write permission only. 1) Execute permission only. 0) No permissions. 3) The name, is the filename of the file that was originally uuencoded. This permits the uudecode program to recreate the original file with its original filename. -- Matthew Lee Stier | Sun Microsystems --- RTP, NC 27709-3447 | "Wisconsin Escapee" uucp: sun!mstier or mcnc!rti!sunpix!matthew | phone: (919) 469-8300 fax: (919) 460-8355 |