1

在 Ubuntu 中,我使用subprocess.Popen调用一个可执行文件,它将一些输出文件保存在服务器的硬盘上。该代码已在本地计算机上成功测试。但是,它在服务器上不起作用。我的代码如下:

#create a new folder. The permission is drwxrwx both locally and on the server end
os.makedirs(folder)

#copy the executable file to this folder. The permission is drwxrwx both locally and on the server end after copy
shutil.copy("a.exe", folder)

#call this exe file. The permission is drwxrwx locally but changed to drwxr-x on the server end. Since I do not have the write permit, my code fails.
subprocess.Popen("a.exe")

我不确定为什么 subprocess 会更改我在服务器端的文件夹权限。那么有人可以给我一些建议吗?

谢谢!

4

1 回答 1

0

尝试:

subprocess.Popen("a.exe", shell=True)
于 2012-05-04T05:59:31.687 回答