Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Mar 2003 15:37:30 -0500 (EST)
From:      Thomas David Rivers <rivers@dignus.com>
To:        parv_fm@emailgroups.net, rivers@dignus.com
Cc:        doc@FreeBSD.ORG, pirat@access.inet.co.th, stable@FreeBSD.ORG
Subject:   Re: uuencode takes very long time
Message-ID:  <200303162037.h2GKbUn20714@lakes.dignus.com>
In-Reply-To: <20030316203223.GA34213@moo.holy.cow>

next in thread | previous in thread | raw e-mail | index | archive | help
> >
> > 	cat my-pr.tar.gz | uuencode my-pr.tar.gz
> ...
> > 	uuencode my-pr.tar.gz my-pr.tar.gz
> 
> Are you mad, man?  It is certainly possible that in the 2d case,
> encoded file & the original would be corrupted/incomplete due to
> race conditions.  In case of a (very) large file, the same thing
> would happen in the 1st case too.
> 
> It is much safer to use a temporary/other name for a file to store
> the (encoded) output.

 I think you're mis-understanding...

 When two options are presented to uuencode, the first one names
 the input file to read.

 The second provides the name of the resulting file when it is
 decoded (presumably at some future time, on a different machine.)

 Thus, 

 	uuencode input-file result-name

 is the better way to consider it.

 This reads "input-file" - writing the output to stdout.  

 That output should be saved into some other file, in the previous
 example, it was piped to something else.

 So, if you wanted to save the result of uuencode, you might:

	uuencode input-file result-name > myuufile


 (no race condition, assuming "input-file" and "myuufile" aren't the
 same.)

 Then - you move the output somewhere else (say - e-mail it),
 when you uudecode the file, the resulting file name will be
 "result-name."   If you want that name to be the same as the
 input file name, you need to use the same name.    If it's
 the same name, on the same file system, then it would overwrite
 the original file... (which may, or may not, be what's intended.)

 So - no - I don't think my sanity is in question, in this
 case, at least.

	- Dave Rivers -

--
rivers@dignus.com                        Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303162037.h2GKbUn20714>