summaryrefslogtreecommitdiff
path: root/subplot/data.py
diff options
context:
space:
mode:
authorAlexander Batischev <eual.jp@gmail.com>2021-04-21 00:38:29 +0300
committerAlexander Batischev <eual.jp@gmail.com>2021-04-21 02:05:55 +0300
commit9c3893cf616279e4101b1ccf52d0a82b7a334b3b (patch)
treeb8ff5b6438252a5c08ae00c796625a00ae453643 /subplot/data.py
parent645392adb2c12649fc72164422fecb15993046e8 (diff)
downloadobnam2-9c3893cf616279e4101b1ccf52d0a82b7a334b3b.tar.gz
feat: add support for CACHEDIR.TAG
Fixes #78.
Diffstat (limited to 'subplot/data.py')
-rw-r--r--subplot/data.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/subplot/data.py b/subplot/data.py
index 3833f2e..d134e5f 100644
--- a/subplot/data.py
+++ b/subplot/data.py
@@ -29,6 +29,13 @@ def create_fifo(ctx, filename=None):
os.mkfifo(filename)
+def create_cachedir_tag_in(ctx, dirpath=None):
+ filepath = f"{dirpath}/CACHEDIR.TAG"
+ logging.debug(f"creating {filepath}")
+ os.makedirs(dirpath, exist_ok=True)
+ open(filepath, "w").write("Signature: 8a477f597d28d172789f06886806bc55")
+
+
def create_nonutf8_filename(ctx, dirname=None):
filename = "\x88"
os.mkdir(dirname)