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

Function create_directories_if_non_existent

bridge/src/client/files.rs:29–43  ·  view source on GitHub ↗
(data_root_path: &Path)

Source from the content-addressed store, hash-verified

27}
28
29pub fn create_directories_if_non_existent(data_root_path: &Path) {
30 if !data_root_path.exists() {
31 fs::create_dir_all(data_root_path).expect("Failed to create directories");
32 }
33
34 let public_data_folder = get_public_data_directory_path(data_root_path);
35 if !public_data_folder.exists() {
36 fs::create_dir(public_data_folder).expect("Failed to create 'public' directory");
37 }
38
39 let private_data_folder = get_private_data_directory_path(data_root_path);
40 if !private_data_folder.exists() {
41 fs::create_dir(private_data_folder).expect("Failed to create 'private' directory");
42 }
43}
44
45pub fn get_private_data_from_file(path: &Path) -> BitVMClientPrivateData {
46 match read_file(path) {

Callers 2

save_local_public_fileFunction · 0.70
save_local_private_fileFunction · 0.70

Tested by

no test coverage detected