OSError:[错误1]不允许操作 [英] OSError: [Error 1] Operation not permitted

查看:154
本文介绍了OSError:[错误1]不允许操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行一个Python脚本,该脚本使用由后链接程序创建的二进制文件(xFiles.bin.addr_patched).但是,我收到此错误.

I am trying to run a python script which uses a binary file (xFiles.bin.addr_patched) created by a postlinker. However, I am getting this error.

File "abc.py", line 74, in ParseCmd
shutil.copy(gOptions.inputX, gWorkingXFile)
File "/usr/lib/python2.6/shutil.py", line 89, in copy
copymode(src, dst)
File "/usr/lib/python2.6/shutil.py", line 66, in copymode
os.chmod(dst, mode)

OSError: [Errno 1] Operation not permitted: 'myPath/xFiles.bin.addr_patched'

当我通过ls-l检查此xFiles.bin的权限时,它表明

When I checked the permissions of this xFiles.bin, by ls-l, it shows that

-rwxrwxrwx 1 nobody  nogroup 

我认为错误是因为此文件是由其他应用程序创建的,正在运行的python脚本无法访问它.因为我是ubuntu的初学者,所以我真的不知道如何解决它.对于如何解决这个问题,有任何的建议吗?

I presume the error is because this file was created by some other application, the python script I am running does not have access to it. Since I am beginner wrt ubuntu, I don't really know how to fix it. Any suggestions on how to fix this?

已解决:

作为答案之一:chown username:groupname文件名解决了此问题

As one of the answers Suggested : chown username:groupname file name fixes this issue

推荐答案

您可以尝试(在命令行中,但是我确定python中有语法):

You could try (from the command line, but I'm sure there's a syntax in python):

sudo chown your_username:your_groupname filename

注意:该组通常只是您的用户名. 我觉得这些权限有问题.每个人的Read Write Execute似乎已关闭.该文件是如何创建的?用户nobody是如何创建它的?

Note: The group is usually just your username. I feel like there's something wrong with those permissions though. Read Write Execute for everyone seems to be off. How was this file created? How did it get to be created by the user nobody?

这篇关于OSError:[错误1]不允许操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆