Skip site navigation (1)Skip section navigation (2)
Date:      23 Oct 1996 23:09:27 -0500
From:      Zach Heilig <zach@blizzard.gaffaneys.com>
To:        freebsd-bugs@freefall.freebsd.org
Subject:   Re: bin/1377
Message-ID:  <874tjlrojs.fsf@bedrock.gaffaneys.com>
In-Reply-To: Bruce Evans's message of Wed, 23 Oct 1996 22:54:58 %2B1000
References:  <199610231254.WAA03226@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> "Bruce" == Bruce Evans <bde@zeta.org.au> writes:

Bruce> It seems about right.  I think it should avoid the magic
Bruce> number 01777 as in cp.

I couldn't find any #defined constants that don't mean something else.
You could replace the (01777) with (~(S_ISGID | S_ISUID)) and get the
same behavior, but those constants were really meant for something
else, right?

>> Note that the actual behavior of cp -p does NOT match the man
>> page (more on this later).

Bruce> Note that mv across doesn't preserve the flags or
Bruce> nanoseconds field in the timestamps.  `cp -p' preserves the
Bruce> flags if possible and rounds the nanonseconds field in the
Bruce> timestamps to the nearest microsecond (it can't do better
Bruce> since there is no way to set the nanoseconds field, and
Bruce> current file systems round to seconds or microseconds
Bruce> anyway).  mv should be more careful to preserve things than
Bruce> `cp -p'

This could be done with just a little more work on the fastcopy()
routine.  I do see some code to preserve the times, but not the flags.

Since you say mv should be more careful than 'cp -p' to preserve
things (*), should the fchown() call be split up, so if mv (or cp -p)
can only preserve one of the *id's, it really does get preserved?

(*): They should be equally careful about preserving things, as mv
calls cp -PRp to do its dirty work when the file is something other
than a regular file.

-- 
Zach Heilig (zach@blizzard.gaffaneys.com) | ALL unsolicited commercial email
Support bacteria -- it's the              | is unwelcome.  I avoid dealing
only culture some people have!            | with companies that email ads.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?874tjlrojs.fsf>