From owner-freebsd-stable Sun Mar 16 12:38: 2 2003 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9094D37B40B; Sun, 16 Mar 2003 12:37:58 -0800 (PST) Received: from dignus.com (ip-64-32-254-102.dsl.iad.megapath.net [64.32.254.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36E2B43F93; Sun, 16 Mar 2003 12:37:57 -0800 (PST) (envelope-from rivers@dignus.com) Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3]) by dignus.com (8.11.6/8.11.3) with ESMTP id h2GKLLX38538; Sun, 16 Mar 2003 15:21:21 -0500 (EST) (envelope-from rivers@dignus.com) Received: (from rivers@localhost) by lakes.dignus.com (8.11.6/8.11.3) id h2GKbUn20714; Sun, 16 Mar 2003 15:37:30 -0500 (EST) (envelope-from rivers) Date: Sun, 16 Mar 2003 15:37:30 -0500 (EST) From: Thomas David Rivers Message-Id: <200303162037.h2GKbUn20714@lakes.dignus.com> To: parv_fm@emailgroups.net, rivers@dignus.com Subject: Re: uuencode takes very long time Cc: doc@FreeBSD.ORG, pirat@access.inet.co.th, stable@FreeBSD.ORG In-Reply-To: <20030316203223.GA34213@moo.holy.cow> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > > > 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