2019-06-12 05:41:31 +00:00
|
|
|
'''
|
|
|
|
Create the file, or update the last modified timestamp.
|
|
|
|
'''
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
from voussoirkit import clipext
|
|
|
|
from voussoirkit import safeprint
|
2020-01-16 06:47:26 +00:00
|
|
|
from voussoirkit import winglob
|
2019-06-12 05:41:31 +00:00
|
|
|
|
|
|
|
def touch(glob_pattern):
|
2020-01-16 06:47:26 +00:00
|
|
|
filenames = winglob.glob(glob_pattern)
|
2019-06-12 05:41:31 +00:00
|
|
|
if len(filenames) == 0:
|
|
|
|
safeprint.safeprint(glob_pattern)
|
|
|
|
open(glob_pattern, 'a').close()
|
|
|
|
else:
|
|
|
|
for filename in filenames:
|
|
|
|
safeprint.safeprint(filename)
|
|
|
|
os.utime(filename)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
glob_patterns = [clipext.resolve(x).strip() for x in sys.argv[1:]]
|
|
|
|
for glob_pattern in glob_patterns:
|
|
|
|
touch(glob_pattern)
|