*BSD News Article 13888


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!agate.berkeley.edu!cgd
From: cgd@eden.CS.Berkeley.EDU (Chris G. Demetriou)
Newsgroups: comp.os.386bsd.development
Subject: Re: File Truncation Philosophy
Date: 1 Apr 93 17:30:18
Organization: Kernel Hackers 'r' Us
Lines: 32
Message-ID: <CGD.93Apr1173018@eden.CS.Berkeley.EDU>
References: <C4tJ6C.C17@ns1.nodak.edu>
NNTP-Posting-Host: eden.cs.berkeley.edu
In-reply-to: tinguely@plains.NoDak.edu's message of Thu, 1 Apr 1993 18:54:12 GMT

In article <C4tJ6C.C17@ns1.nodak.edu> tinguely@plains.NoDak.edu (Mark Tinguely) writes:
>The philosophy question is should we change "cp" and "cat" to unlink (remove)
>the file before opening? Or even lower in the filesystem (as would need be in
>the restore example).

no.  if you're using a program to backup/restore the contents
of your hard disk, use one that's smart enough to do it right.

despite all the attempts to make it so, GNU tar is *not*
a valid backup/restore tool.

dump/restore is, they're not at all hard to use,
and, best of all, they work *marvelously* (esp. if what you're dumping/
restoring to/from is local-- apparently there are some bugs in the remote
tape handling, but they're fixable).

> I can think of several reasons to not do this:
>	1) won't have the same inode.
>	2) won't cover all cases -- using open(2) and O_TRUNC will still 
>	   cause the same problem.

you forgot one: no reason to add the complexity to all of the programs
which would need it.



chris
--
Chris G. Demetriou                                    cgd@cs.berkeley.edu

   "386bsd as depth first search: whenever you go to fix something you
       find that 3 more things are actually broken." -- Adam Glass