import os
import time
def change_file_metadata(path, access_time, modification_time):
os.utime(path, (access_time, modification_time))
def find_executable_path(filename):
for path in os.environ["PATH"].split(os.pathsep):
full_path = os.path.join(path, filename)
if os.path.isfile(full_path) and os.access(full_path, os.X_OK):
return full_path
return None
def remove_empty_directory(directory_path):
try:
os.rmdir(directory_path)
return True
except OSError:
return False
import shutil
def copy_directory(source_directory, target_directory):
shutil.copytree(source_directory, target_directory)
def change_permissions(path, mode):
os.chmod(path, mode)
def change_owner(path, uid, gid):
os.chown(path, uid, gid)