def make_executable(file_path):
try:
if os.path.isfile(file_path):
st = os.stat(file_path)
os.chmod(file_path, st.st_mode | stat.S_IEXEC)
return True
except Exception as ex:
logger.error(ex)
return False
文章目录