MCPcopy Create free account
hub / github.com/KnowledgeXLab/LeanRAG / create_if_not_exist

Function create_if_not_exist

tools/io_file.py:15–17  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

13logger = logger_factory.setup_logger('io_file')
14
15def create_if_not_exist(path):
16 if not os.path.exists(os.path.dirname(path)): # 如果目录不存在,递归创建该目录
17 os.makedirs(path, exist_ok=True)
18
19
20def read(file_path, chunk_size=1024*1024*10000, line_threshold=1000000, encoding='utf-8'):

Callers 1

writeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected