def exists(path):
return os.path.exists(path)
def list_directory_contents(directory):
return os.listdir(directory)
def rename_or_move_file(current_path, new_path):
os.rename(current_path, new_path)
import os
def list_directory_recursively(directory):
paths = []
for root, dirs, files in os.walk(directory):
for name in files:
paths.append(os.path.join(root, name))
for name in dirs:
paths.append(os.path.join(root, name))
return paths
def create_symbolic_link(source, target):
os.symlink(source, target)
def get_last_modification_time(path):
return os.path.getmtime(path)