os.O_EXLOCK(独占锁)在Linux上的Python中不存在

2024-10-01 17:36:06 发布

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

正如您在下面看到的,我在Linux(RHEL)上运行Python2.6,但由于某些原因它没有os.O_EXLOCK。有什么原因吗?有办法解决这个问题吗?在

Python 2.6.5 (r265:79063, Apr  9 2010, 11:16:46) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.O_EXLOCK
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'O_EXLOCK'
>>> os.O_DSYNC
4096
>>>

Tags: osonlinuxhattype原因redapr
1条回答
网友
1楼 · 发布于 2024-10-01 17:36:06

the Python Standard Library documentation所述

The following constants are options for the flags parameter to the open() function. They can be combined using the bitwise OR operator |. Some of them are not available on all platforms. For descriptions of their availability and use, consult the open(2) manual page on Unix or the MSDN on Windows.

O_EXLOCKoriginated in the BSD world;它通常在Linux上不可用。{a3}可以改为使用。在

相关问题 更多 >

    热门问题