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

Function change_directory

bridge/src/client/data_store/ftp/lib.rs:406–430  ·  view source on GitHub ↗
(
    insecure_ftp_stream: Option<&mut AsyncFtpStream>,
    secure_ftp_stream: Option<&mut AsyncNativeTlsFtpStream>,
    file_path: Option<&str>,
)

Source from the content-addressed store, hash-verified

404}
405
406async fn change_directory(
407 insecure_ftp_stream: Option<&mut AsyncFtpStream>,
408 secure_ftp_stream: Option<&mut AsyncNativeTlsFtpStream>,
409 file_path: Option<&str>,
410) -> Result<(), String> {
411 if let Some(path) = file_path {
412 if let Some(ftp_stream) = secure_ftp_stream {
413 match ftp_stream.cwd(path).await {
414 Ok(_) => {}
415 Err(err) => {
416 return Err(format!("Failed to change directory to {}: {}", path, err));
417 }
418 }
419 } else if let Some(ftp_stream) = insecure_ftp_stream {
420 match ftp_stream.cwd(path).await {
421 Ok(_) => {}
422 Err(err) => {
423 return Err(format!("Failed to change directory to {}: {}", path, err));
424 }
425 }
426 }
427 }
428
429 Ok(())
430}
431
432async fn create_directories_if_non_existent(
433 insecure_ftp_stream: Option<&mut AsyncFtpStream>,

Callers 1

get_objectFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected