From 5bbb12b8a27e5df26e8d8329028d44df13500725 Mon Sep 17 00:00:00 2001 From: ptg Date: Wed, 9 Oct 2024 16:00:27 -0400 Subject: [PATCH] mkdir --- ptgctl/tools/display.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ptgctl/tools/display.py b/ptgctl/tools/display.py index 09adbff..734b008 100644 --- a/ptgctl/tools/display.py +++ b/ptgctl/tools/display.py @@ -121,7 +121,8 @@ async def raw(api, stream_id, utf=False, **kw): @util.async2sync @util.interruptable -async def file(api, stream_id, out_dir, include_timestamps=False, **kw): +async def file(api, stream_id, out_dir='', include_timestamps=False, **kw): + os.makedirs(out_dir or '.', exist_ok=True) async with api.data_pull_connect(stream_id, **kw) as ws: with contextlib.ExitStack() as stack: files = {}