Page MenuHomeFreeBSD

cp: Improved conformance when copying directories.
ClosedPublic

Authored by des on Apr 1 2024, 1:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 24, 3:04 AM
Unknown Object (File)
Wed, Jan 22, 8:19 AM
Unknown Object (File)
Mon, Jan 20, 9:15 PM
Unknown Object (File)
Oct 22 2024, 6:14 AM
Unknown Object (File)
Oct 22 2024, 6:14 AM
Unknown Object (File)
Oct 22 2024, 6:14 AM
Unknown Object (File)
Oct 22 2024, 6:09 AM
Unknown Object (File)
Oct 2 2024, 11:43 AM
Subscribers

Details

Summary
  • When copying a directory, if the destination exists and is not a directory, we would previously emit an error message and exit. The correct behavior according to POSIX is to emit an error message and continue without descending further into the source directory.
  • When copying a directory, if the destination does not exist and we fail to create it, we would previously emit an error message and exit. The correct behavior according to POSIX is to emit an error message and continue. Whether to descend further into the source directory is explicitly left unspecified; GNU cp does not, which seems to me to be the safer and less surprising option, so let's not either.

MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable