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

Function mv

tests/shell.py:71–78  ·  view source on GitHub ↗

Moves files or directories.

(src_path, dest_path)

Source from the content-addressed store, hash-verified

69
70
71def mv(src_path, dest_path):
72 """Moves files or directories."""
73 try:
74 os.rename(src_path, dest_path)
75 except OSError:
76 # this will happen on windows
77 os.remove(dest_path)
78 os.rename(src_path, dest_path)
79
80
81def mkdtemp():

Callers 15

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
test___init__Function · 0.85
test_move_fromFunction · 0.85
test_move_toFunction · 0.85
test_move_internalFunction · 0.85
test_move_internal_batchFunction · 0.85

Calls 1

removeMethod · 0.45

Tested by 15

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
test___init__Function · 0.68
test_move_fromFunction · 0.68
test_move_toFunction · 0.68
test_move_internalFunction · 0.68
test_move_internal_batchFunction · 0.68