MCPcopy
hub / github.com/InternLM/MindSearch / ensure_dir

Method ensure_dir

docker/msdl/config.py:8–13  ·  view source on GitHub ↗

Ensure the directory exists, create if it doesn't

(dir_path)

Source from the content-addressed store, hash-verified

6class FileSystemManager:
7 @staticmethod
8 def ensure_dir(dir_path):
9 """Ensure the directory exists, create if it doesn't"""
10 path = Path(dir_path)
11 if not path.exists():
12 path.mkdir(parents=True, exist_ok=True)
13 return path
14
15 @staticmethod
16 def ensure_file(file_path, default_content=""):

Callers 2

ensure_fileMethod · 0.80
config.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected