Python2.6:打开4GB文件会在AIX上引发“IOError:[Errno 127]Value too large to be storage in data type”(IOError:[Errno 127]值太大,无法存储在数据类型中)

2024-03-28 13:15:12 发布

您现在位置:Python中文网/ 问答频道 /正文

在Python上打开AIX.4g2.I文件时出错:

>>> fd = open('/mnt/t/MY_BIG_4GB_FILE', 'r')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: [Errno 127] Value too large to be stored in data type: '/mnt/t/MY_BIG_4GB_FILE'

有什么解决办法吗?我没有在谷歌上找到信息。在

编辑: 为了阅读大文件,我做了一些事情(我知道这是垃圾,但有时您根本无法更改python版本):

^{pr2}$

Tags: 文件inmostmyopencallfilelast
1条回答
网友
1楼 · 发布于 2024-03-28 13:15:12

你要找的是“大文件支持”。这里有一个不错的简介:http://docs.python.org/2/library/posix.html#large-file-support。您可能需要使用适当的选项重新编译Python解释器,或者找到具有这些选项的预构建解释器。如果可以的话,可以尝试构建Python2.7版本。在

相关问题 更多 >