MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / move_file_on_disk

Method move_file_on_disk

atomic-cli/src/commands/mv.rs:172–182  ·  view source on GitHub ↗

Move the actual file on disk.

(&self, repo_root: &Path, from: &str, to: &str)

Source from the content-addressed store, hash-verified

170
171 /// Move the actual file on disk.
172 fn move_file_on_disk(&self, repo_root: &Path, from: &str, to: &str) -> std::io::Result<()> {
173 let from_path = repo_root.join(from);
174 let to_path = repo_root.join(to);
175
176 // Create parent directories if needed
177 if let Some(parent) = to_path.parent() {
178 std::fs::create_dir_all(parent)?;
179 }
180
181 std::fs::rename(&from_path, &to_path)
182 }
183}
184
185impl Command for Move {

Callers 1

runMethod · 0.80

Calls 1

parentMethod · 0.80

Tested by

no test coverage detected