uutils/coreutils · error

Failed to open renamed file for syncing

Error message

Failed to open renamed file for syncing

What it means

Error "Failed to open renamed file for syncing" thrown in uutils/coreutils.

Source

Thrown at src/uu/shred/src/shred.rs:826

                continue;
            }
            match fs::rename(&last_path, &new_path) {
                Ok(()) => {
                    if verbose {
                        show_error!(
                            "{}: {} {}",
                            last_path.maybe_quote().to_string(),
                            translate!("shred-renamed-to"),
                            new_path.display().to_string()
                        );
                    }

                    if remove_method == RemoveMethod::WipeSync {
                        // Sync every file rename
                        let new_file = OpenOptions::new()
                            .write(true)
                            .open(new_path.clone())
                            .expect("Failed to open renamed file for syncing");
                        new_file.sync_all().expect("Failed to sync renamed file");
                    }

                    last_path = new_path;
                    break;
                }
                Err(e) => {
                    let msg = translate!("shred-couldnt-rename", "file" => last_path.maybe_quote(), "new_name" => new_path.quote(), "error" => e);
                    show_error!("{msg}");
                    // TODO: replace with our error management
                    std::process::exit(1);
                }
            }
        }
    }

    last_path
}

View on GitHub (pinned to 8b8cbfd51b)

Solutions

  1. Verify the renamed file exists and permissions allow opening it before syncing.
  2. Check that the rename operation succeeded and the path was constructed correctly.

When it happens

Trigger: Occurs when shred renames a file during wiping but then cannot reopen the renamed file to sync it.

Common situations: Permissions changed, the file was removed by another process, or filesystem errors during shred's rename-unlink loop.


AI-assisted analysis of uutils/coreutils@8b8cbfd51b (2026-08-19). Data as JSON: /api/errors/0b04e6b2dd544c20. Report an issue: GitHub.