🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.unix
Article #492

Re: Query about P1003.2 'cp' utility

#492
From: John T Kohl
Date: Fri, 07 Sep 1990 16:25
16 lines
1243 bytes
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 <jtkohl@ATHENA.MIT.EDU> or <jtkohl@MIT.EDU>
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
Technical Details
Message-ID: <494@usenix.ORG>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!usenix!std-unix
References: <490@usenix.ORG> <DJM.90Aug17151613@jolt.eng.umd.edu> <439@usenix.ORG>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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> <DJM.90Aug17151613@jolt.eng.umd.edu> <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