MCPcopy Create free account
hub / github.com/chatmail/core / create_folder

Function create_folder

src/tools.rs:444–462  ·  view source on GitHub ↗
(context: &Context, path: &Path)

Source from the content-addressed store, hash-verified

442}
443
444pub(crate) async fn create_folder(context: &Context, path: &Path) -> Result<(), io::Error> {
445 let path_abs = get_abs_path(context, path);
446 if !path_abs.exists() {
447 match fs::create_dir_all(path_abs).await {
448 Ok(_) => Ok(()),
449 Err(err) => {
450 warn!(
451 context,
452 "Cannot create directory \"{}\": {}",
453 path.display(),
454 err
455 );
456 Err(err)
457 }
458 }
459 } else {
460 Ok(())
461 }
462}
463
464/// Write a the given content to provided file path.
465pub(crate) async fn write_file(

Callers 1

imex_innerFunction · 0.85

Calls 2

get_abs_pathFunction · 0.85
existsMethod · 0.45

Tested by

no test coverage detected