MCPcopy
hub / github.com/gorakhargosh/watchdog / touch

Function touch

tests/shell.py:56–62  ·  view source on GitHub ↗

Updates the modified timestamp of a file or directory.

(path, times=None)

Source from the content-addressed store, hash-verified

54
55
56def touch(path, times=None):
57 """Updates the modified timestamp of a file or directory."""
58 if os.path.isdir(path):
59 os.utime(path, times)
60 else:
61 with open(path, "ab"):
62 os.utime(path, times)
63
64
65def truncate(path):

Callers 15

create_filesFunction · 0.85
test_watchdog_recursiveFunction · 0.85
test_move_toFunction · 0.85
test_move_fromFunction · 0.85
test_move_internalFunction · 0.85
test_move_replaceFunction · 0.85
test_dir_modify_on_moveFunction · 0.85

Calls 1

isdirMethod · 0.80

Tested by 15

create_filesFunction · 0.68
test_watchdog_recursiveFunction · 0.68
test_move_toFunction · 0.68
test_move_fromFunction · 0.68
test_move_internalFunction · 0.68
test_move_replaceFunction · 0.68
test_dir_modify_on_moveFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…