From 97fbe845e5dfdbda22521117c1783e1fd8515952 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Mon, 12 Jul 2021 20:52:49 -0700 Subject: Random changes. --- file_utils.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'file_utils.py') 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 -- cgit v1.3