def childproc_filialusurp(umask, chdir, umask_path, sid_path, wdir_path,
pid_path):
_filial_usurpation(chdir, umask)
# Get our session id
my_pid = os.getpid()
sid = os.getsid(my_pid)
# reset umask and get our set one.
umask = os.umask(0)
# Get our working directory.
wdir = os.path.abspath(os.getcwd())
# Update parent
# Write the umask to the response path
with open(umask_path, 'w') as f:
f.write(str(umask) + '\n')
# Write the sid to the response path
with open(sid_path, 'w') as f:
f.write(str(sid) + '\n')
# Write the working dir to the response path
with open(wdir_path, 'w') as f:
f.write(wdir + '\n')
# Write the pid to the response path
with open(pid_path, 'w') as f:
f.write(str(my_pid) + '\n')
# ###############################################
# Testing
# ###############################################
评论列表
文章目录