diff --git a/src/uu/rm/src/rm.rs b/src/uu/rm/src/rm.rs index c52497df1..f1f45cf52 100644 --- a/src/uu/rm/src/rm.rs +++ b/src/uu/rm/src/rm.rs @@ -524,7 +524,7 @@ fn prompt_file(path: &Path, options: &Options) -> bool { } } } - // File::open(path) doesn't open the file in write mode so we need to use file options to open it in also write mode to check if it can written too + let Ok(metadata) = fs::metadata(path) else { return true; };