mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 20:47:46 +00:00
install: document the need_copy function
This commit is contained in:
parent
c0206c5ea4
commit
0fb3ffb8ad
1 changed files with 1 additions and 2 deletions
|
@ -869,7 +869,6 @@ fn preserve_timestamps(from: &Path, to: &Path) -> UResult<()> {
|
||||||
///
|
///
|
||||||
fn copy(from: &Path, to: &Path, b: &Behavior) -> UResult<()> {
|
fn copy(from: &Path, to: &Path, b: &Behavior) -> UResult<()> {
|
||||||
if b.compare && !need_copy(from, to, b)? {
|
if b.compare && !need_copy(from, to, b)? {
|
||||||
println!("no need to copy");
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
// Declare the path here as we may need it for the verbose output below.
|
// Declare the path here as we may need it for the verbose output below.
|
||||||
|
@ -938,7 +937,7 @@ fn need_copy(from: &Path, to: &Path, b: &Behavior) -> UResult<bool> {
|
||||||
let all_modes: u32 = 0o7777;
|
let all_modes: u32 = 0o7777;
|
||||||
|
|
||||||
// Check if any special mode bits are set in the specified mode,
|
// Check if any special mode bits are set in the specified mode,
|
||||||
// source file mode, or destination file mode. If so, copy is needed.
|
// source file mode, or destination file mode.
|
||||||
if b.specified_mode.unwrap_or(0) & extra_mode != 0
|
if b.specified_mode.unwrap_or(0) & extra_mode != 0
|
||||||
|| from_meta.mode() & extra_mode != 0
|
|| from_meta.mode() & extra_mode != 0
|
||||||
|| to_meta.mode() & extra_mode != 0
|
|| to_meta.mode() & extra_mode != 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue