From owner-freebsd-hackers Tue Dec 4 12:43:41 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id A8E1737B405 for ; Tue, 4 Dec 2001 12:43:36 -0800 (PST) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 4 Dec 2001 20:43:32 +0000 (GMT) To: Matthew Dillon Cc: Bernd Walter , cjclark@alum.mit.edu, Mark Hannon , hackers@FreeBSD.ORG Subject: Re: bin/32261: dump creates a dump file much larger than sum of dumped files In-Reply-To: Your message of "Tue, 04 Dec 2001 11:57:01 PST." <200112041957.fB4Jv1j20226@apollo.backplane.com> Date: Tue, 04 Dec 2001 20:43:31 +0000 From: Ian Dowse Message-ID: <200112042043.aa94374@salmon.maths.tcd.ie> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <200112041957.fB4Jv1j20226@apollo.backplane.com>, Matthew Dillon wri tes: > Woa! That sounds like a bad idea to me. If you want to do it right > then open(), fstat(), and only if the stat says it is a regular file > do you then ftruncate(). Passing O_TRUNC to a tape device may be ignored > by us, but it's not a valid flag to pass to a tape device and we shouldn't > do it. Yeah, I guess checking the file type first makes more sense. I tend to use shell `>' redirects a lot when accessing tape devices. They unconditionally add O_TRUNC, so I know I'd be very surprised if there were side-effects! However for dump I agree that it's best not to make such assumptions. Ian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message