MCPcopy Create free account
hub / github.com/BitVM/BitVM / change_directory

Function change_directory

bridge/src/client/data_store/sftp.rs:329–345  ·  view source on GitHub ↗
(sftp: &_Sftp, file_path: Option<&str>)

Source from the content-addressed store, hash-verified

327}
328
329async fn change_directory(sftp: &_Sftp, file_path: Option<&str>) -> Result<(), String> {
330 if let Some(path) = file_path {
331 let mut fs = sftp.fs();
332 fs.set_cwd(path);
333 let result = fs.open_dir(path).await;
334 drop(fs);
335 if result.is_err() {
336 return Err(format!(
337 "Failed to change directory to {}: {}",
338 path,
339 result.err().unwrap()
340 ));
341 }
342 }
343
344 Ok(())
345}
346
347async fn create_directories_if_non_existent(
348 sftp: &_Sftp,

Callers 1

connectFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected