[][src]Function coreutils_core::backup::create_numbered_backup

pub fn create_numbered_backup(file: &Path) -> Result<PathBuf, Error>

Creates a numbered backup. Does so by taking the input file and poking the parent directory to find a file of the form <file>~<X>~ where X is a number. If none can be found, a backup file is created where X is 1. Else, it creates a backup file where X is X + 1.

Errors

If this function encounters any kind of I/O error, an error variant will be returned.