Skip to content

Commit

Permalink
fix: gran coglioni
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Nov 17, 2024
1 parent 7bc87be commit d245962
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions remotefs-fuse/tests/driver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ fn make_file_at(remote: &mut MemoryFs, path: &Path, content: &[u8]) {
/// Make directory on the remote fs at `path`
///
/// All the stems in the path will be created if they do not exist.
#[cfg(windows)]
fn make_dir_at(remote: &mut MemoryFs, path: &Path) {
use path_slash::PathBufExt;

Expand All @@ -85,3 +86,23 @@ fn make_dir_at(remote: &mut MemoryFs, path: &Path) {
}
}
}

/// Make directory on the remote fs at `path`
///
/// All the stems in the path will be created if they do not exist.
#[cfg(unix)]
fn make_dir_at(remote: &mut MemoryFs, path: &Path) {
let mut abs_path = Path::new("/").to_path_buf();
for stem in path.iter() {
abs_path.push(stem);
println!("Creating directory: {abs_path:?}");
match remote.create_dir(&abs_path, UnixPex::from(0o755)) {
Ok(_)
| Err(RemoteError {
kind: RemoteErrorType::DirectoryAlreadyExists,
..
}) => {}
Err(err) => panic!("Failed to create directory: {err}"),
}
}
}

0 comments on commit d245962

Please sign in to comment.