mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-02 05:57:46 +00:00
touch: fix error handling
This commit is contained in:
parent
33e4b96675
commit
13e912bcbd
1 changed files with 5 additions and 1 deletions
|
@ -103,7 +103,11 @@ Try 'touch --help' for more information."##,
|
|||
|
||||
let path = pathbuf.as_path();
|
||||
|
||||
if !path.exists() {
|
||||
if let Err(e) = path.metadata() {
|
||||
if e.kind() != std::io::ErrorKind::NotFound {
|
||||
return Err(e.map_err_context(|| format!("setting times of {}", filename.quote())));
|
||||
}
|
||||
|
||||
if matches.contains_id(options::NO_CREATE) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue