rename directory entries

This commit is contained in:
2025-07-16 06:23:24 +02:00
parent b121c27b37
commit a2cb58867c
16 changed files with 389 additions and 21 deletions

View File

@@ -1,6 +1,6 @@
use std::time::UNIX_EPOCH;
use anyhow::{Context, anyhow};
use anyhow::{Context, anyhow, bail};
use tokio::{fs, io::AsyncWriteExt as _};
use crate::domain::warren::{
@@ -156,6 +156,10 @@ impl FileSystem {
FilePath::new(&c)?
};
if fs::try_exists(&new_path).await? {
bail!("File already exists");
}
fs::rename(current_path, &new_path).await?;
Ok(new_path)