feat(storage): add mkdir to FileSystem trait with stubs
This commit is contained in:
@@ -82,6 +82,15 @@ impl<F: FileSystem> Server for StorageServer<F> {
|
||||
None => StorageResponse::Error,
|
||||
}
|
||||
}
|
||||
StorageRequest::Mkdir { path } => {
|
||||
let buf = path.to_bytes();
|
||||
let len = buf.iter().position(|&b| b == 0).unwrap_or(16);
|
||||
if self.fs.mkdir(&buf[..len]) {
|
||||
StorageResponse::Ok
|
||||
} else {
|
||||
StorageResponse::Error
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user