Project

General

Profile

Submit #2988

cpdup should ignore UF_ARCHIVE when deciding whether to copy a file

Added by asomers 9 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Userland
Target version:
-
Start date:
03/24/2017
Due date:
% Done:

0%


Description

On operating systems that support it (including Illumos, FreeBSD, and Windows), the UF_ARCHIVE flag means that a file needs to be archived. Filesystems that support this flag (including msdosfs and ZFS) will set it automatically when the file is created.

When deciding whether to copy a file, cpdup should ignore the UF_ARCHIVE file flag. If that flag is supported by the destination file system but it's cleared on a source file, then multiple invocations of cpdup would all copy the source file because its flags wouldn't match. OTOH, if the destination filesystem doesn't support UF_ARCHIVE, then there's no point in cpdup setting it.

Steps to reproduce, using ZFS on FreeBSD:
$ mkdir src dst
$ touch src/foo
$ chflags 0 src/foo
$ cpdup -v src dst
dst/foo copy-ok
$ cpdup -v src dst
dst/foo copy-ok

submit_2988.diff View (995 Bytes) asomers, 03/24/2017 03:48 PM

History

#1 Updated by asomers 9 months ago

#2 Updated by swildner 2 months ago

  • Status changed from New to Closed

Pushed, thanks!

Also available in: Atom PDF