From: David Stainton Date: Mon, 5 Oct 2015 10:59:58 +0000 (+0200) Subject: For all downloaded files ensure parent dir exists X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/somewhere?a=commitdiff_plain;h=24334159d10dcdaa8cd9baf945d86b248eb81024;p=tahoe-lafs%2Ftahoe-lafs.git For all downloaded files ensure parent dir exists --- diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index b6a9476f..e32459c1 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -580,6 +580,11 @@ class Downloader(QueueMixin): if now is None: now = time.time() + # ensure parent directory exists + head, tail = os.path.split(abspath_u) + mode = 0777 # XXX + fileutil.make_dirs(head, mode) + fileutil.write(replacement_path_u, file_contents) os.utime(replacement_path_u, (now, now - cls.FUDGE_SECONDS)) if is_conflict: