Path: utzoo!utgpu!watserv1!watmath!att!occrsh!uokmax!munnari.oz.au!uunet!usenix!std-unix From: cowan@marob.masa.com (John Cowan) Newsgroups: comp.std.unix Subject: Re: Query about P1003.2 'cp' utility Message-ID: <496@usenix.ORG> Date: 7 Sep 90 16:12:07 GMT References: <490@usenix.ORG> <439@usenix.ORG> Sender: std-unix@usenix.ORG Organization: ESCC, New York City Lines: 16 Approved: jsq@usenix.org (Moderator, John Quarterman) X-Submissions: std-unix@uunet.uu.net From: cowan@marob.masa.com (John Cowan) 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. The difference between unlinking before opening and opening with O_TRUNC is, of course, that the former course of action can change the file's owner, group, and mode settings, whereas the latter course of action cannot. -- cowan@marob.masa.com (aka ...!hombre!marob!cowan) e'osai ko sarji la lojban Volume-Number: Volume 21, Number 90