summaryrefslogtreecommitdiff
path: root/file_utils.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2021-07-12 20:52:49 -0700
committerScott Gasch <[email protected]>2021-07-12 20:52:49 -0700
commit97fbe845e5dfdbda22521117c1783e1fd8515952 (patch)
tree8b0ac61be1d670621abc994beef84e249f0ad95a /file_utils.py
parenta838c154135b2420d9047a101caf24a2c9f593c2 (diff)
Random changes.
Diffstat (limited to 'file_utils.py')
-rw-r--r--file_utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/file_utils.py b/file_utils.py
index d545124..464b0e7 100644
--- a/file_utils.py
+++ b/file_utils.py
@@ -7,6 +7,7 @@ import errno
import hashlib
import logging
import os
+import pathlib
import time
from typing import Optional
import glob
@@ -219,6 +220,10 @@ def describe_file_mtime(filename: str, *, brief=False) -> Optional[str]:
return describe_file_timestamp(filename, lambda x: x.st_mtime, brief=brief)
+def touch_file(filename: str) -> bool:
+ return pathlib.Path(filename).touch()
+
+
def expand_globs(in_filename: str):
for filename in glob.glob(in_filename):
yield filename