Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!usenix!std-unix From: jtkohl@MIT.EDU (John T Kohl) Newsgroups: comp.std.unix Subject: Re: Query about P1003.2 'cp' utility Message-ID: <494@usenix.ORG> Date: 7 Sep 90 16:25:05 GMT References: <490@usenix.ORG> <439@usenix.ORG> Sender: std-unix@usenix.ORG Organization: MIT Project Athena Lines: 16 Approved: jsq@usenix.org (Moderator, John Quarterman) X-Submissions: std-unix@uunet.uu.net From: jtkohl@MIT.EDU (John T Kohl) In article <490@usenix.ORG> caywood@teb.larc.nasa.gov (John Caywood) writes: > I take this to mean that, no, cp doesn't unlink an existing file, but > it truncates it upon opening under these conditions. Consequently, > yes, djm is correct, cp doesn't unlink. I don't understand, though, > why opening with O_TRUNC isn't equivalent. Consider the case where the file in question has several hard links from different filenames. O_TRUNC is not equivalent to unlink. -- John Kohl or Digital Equipment Corporation/Project Athena (The above opinions are MINE. Don't put my words in somebody else's mouth!) Volume-Number: Volume 21, Number 88