aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qolab/file_utils/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/qolab/file_utils/__init__.py b/qolab/file_utils/__init__.py
index 7a435db..517a28e 100644
--- a/qolab/file_utils/__init__.py
+++ b/qolab/file_utils/__init__.py
@@ -60,11 +60,12 @@ def get_runnum(data_dir):
f.close()
return(run_number)
-def get_next_data_file(prefix, savepath, run_number=None, date_format='%Y%m%d', extention='dat'):
+def get_next_data_file(prefix, savepath, run_number=None, datestr=None, date_format='%Y%m%d', extention='dat'):
if run_number is None:
run_number = get_runnum( savepath )
today = date.today()
- datestr = today.strftime(date_format)
+ if datestr is None:
+ datestr = today.strftime(date_format)
fname = os.path.join(savepath, f'{prefix}_{datestr}_{run_number:05d}.{extention}')
return(fname)