在AFP卷上使用Python创建和写入文件时出错

0 投票
1 回答
803 浏览
提问于 2025-04-29 05:31

有没有人知道在用Python(2.7.3)写入一个已经挂载的afp卷时会遇到什么问题吗?

>f = open("/mnt/foo/test.txt","w+");

这样做的结果是

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: [Errno 5] Input/output error: '/mnt/foo/test.txt'

Python虽然创建了文件,但我无法使用这个文件对象。当我尝试对一个已经存在的文件做同样的操作时,一切都正常,没有错误。

暂无标签

1 个回答

1

请检查一下/mnt/foo/test.txt这个文件的权限。这可以解决问题。

撰写回答