Skip to main content

rename_file

Function rename_file 

Source
pub fn rename_file(root: &Path) -> Result<PathBuf, String>
Expand description

Renames the file’s first name, sioul-cases.toml, to sioul-projects.toml, and its [[case]] tables to [[project]], in one write: every field, route and comment kept, and checked to be so before anything is written. The old file stays beside the new one, as sioul-cases.toml.before-rename. Never done by itself: an older Sioul reads only the first name, so the person chooses when (Settings ▸ Your folder and sharing). Refused when sioul-projects.toml is already there. Returns where the old file was kept.