Commit 9fee2ce0 authored by liukaiwen's avatar liukaiwen
Browse files

io modules

parent fe58649b
...@@ -35,8 +35,8 @@ class DiskReaderWriter(AbsReaderWriter): ...@@ -35,8 +35,8 @@ class DiskReaderWriter(AbsReaderWriter):
abspath = path abspath = path
else: else:
abspath = os.path.join(self.path, path) abspath = os.path.join(self.path, path)
if not os.path.exists(abspath):
directory_path = os.path.dirname(abspath) directory_path = os.path.dirname(abspath)
if not os.path.exists(directory_path):
os.makedirs(directory_path) os.makedirs(directory_path)
if mode == MODE_TXT: if mode == MODE_TXT:
with open(abspath, "w", encoding=self.encoding) as f: with open(abspath, "w", encoding=self.encoding) as f:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment