else/Toolbox/touch.py
Ethan Dalool b0187f3269 else
2016-11-17 22:24:52 -08:00

15 lines
339 B
Python

import glob
import os
import sys
glob_patterns = sys.argv[1:]
for glob_pattern in glob_patterns:
filenames = glob.glob(glob_pattern)
if len(filenames) == 0:
print(glob_pattern)
open(glob_pattern, 'a').close()
else:
for filename in filenames:
print(filename)
os.utime(filename)