From owner-freebsd-hackers Thu Feb 8 9:34:45 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 7561537B491 for ; Thu, 8 Feb 2001 09:34:25 -0800 (PST) Received: (from dillon@localhost) by earth.backplane.com (8.11.1/8.9.3) id f18HXTp07738; Thu, 8 Feb 2001 09:33:29 -0800 (PST) (envelope-from dillon) Date: Thu, 8 Feb 2001 09:33:29 -0800 (PST) From: Matt Dillon Message-Id: <200102081733.f18HXTp07738@earth.backplane.com> To: Tony Finch Cc: Greg Black , Andre Oppermann , Rik van Riel , Mike Silbersack , Poul-Henning Kamp , Charles Randall , Dan Phoenix , Alfred Perlstein , Jos Backus , freebsd-hackers@FreeBSD.ORG, Tony Finch Subject: Re: soft updates and qmail (RE: qmail IO problems) References: <3A805035.C71AAD5E@monzoon.net> <200102061943.f16Jhp365113@earth.backplane.com> <3A805938.96ED890D@monzoon.net> <20010207110208.G74296@hand.dotat.at> <20010208081542.M74296@hand.dotat.at> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :>> already existing? :> :>Why not just read the man page for rename(2) before making :>suggestions? : :I did. I'm glad I was right that it's deleting the destination that is :the problem. I would have thought it would be easy to be sure that :spool filenames are unique, but OTOH I guess that's not completely :robust. : :Tony. :-- :f.a.n.finch fanf@covalent.net dot@dotat.at Yes, rename() will 'delete' the destination file if it previously existed. Of course, if the spool file names are unique then you are not in danger of deleting anything on the destination. If softupdates is turned on, rename() is 100% safe -- softupdates will guarentee that the file will exist in one directory or the other, and never get lost. The absolute worst crash-case that can occur is for the file to wind up in both directories (as if a hardlink had been issued). There is no need for a link() operation followed by a remove(). -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message