Linux上的Python中不存在os.O_EXLOCK(独占锁)
发布时间:2020-12-14 00:28:39 所属栏目:Linux 来源:网络整理
导读:正如您在下面看到的,我在 Linux(RHEL)上运行 Python 2.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 linux2Type "help","copyrig
正如您在下面看到的,我在
Linux(RHEL)上运行
Python 2.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 >>> 解决方法
如
the Python Standard Library documentation所述,
O_EXLOCK originated in the BSD world;它通常不适用于Linux.您也许可以使用Python (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |