mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
chmod: pad all file modes to 4 digits
This commit is contained in:
parent
52cfd4c6cb
commit
080998b6ef
2 changed files with 4 additions and 4 deletions
|
@ -323,7 +323,7 @@ impl Chmoder {
|
|||
}
|
||||
if self.verbose {
|
||||
show_error!(
|
||||
"failed to change mode of file '{}' from {:o} ({}) to {:o} ({})",
|
||||
"failed to change mode of file '{}' from {:04o} ({}) to {:04o} ({})",
|
||||
file.display(),
|
||||
fperm,
|
||||
display_permissions_unix(fperm as mode_t, false),
|
||||
|
@ -335,7 +335,7 @@ impl Chmoder {
|
|||
} else {
|
||||
if self.verbose || self.changes {
|
||||
show_error!(
|
||||
"mode of '{}' changed from {:o} ({}) to {:o} ({})",
|
||||
"mode of '{}' changed from {:04o} ({}) to {:04o} ({})",
|
||||
file.display(),
|
||||
fperm,
|
||||
display_permissions_unix(fperm as mode_t, false),
|
||||
|
|
|
@ -330,8 +330,8 @@ fn test_chmod_recursive() {
|
|||
.arg("a")
|
||||
.arg("z")
|
||||
.succeeds()
|
||||
.stderr_contains(&"to 333 (-wx-wx-wx)")
|
||||
.stderr_contains(&"to 222 (-w--w--w-)");
|
||||
.stderr_contains(&"to 0333 (-wx-wx-wx)")
|
||||
.stderr_contains(&"to 0222 (-w--w--w-)");
|
||||
|
||||
assert_eq!(at.metadata("z/y").permissions().mode(), 0o100222);
|
||||
assert_eq!(at.metadata("a/a").permissions().mode(), 0o100222);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue