|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /usr/lib64/python2.7/site-packages/django/core/files/ |
Upload File : |
�
r�\c @ s8 d Z d Z d Z yR d d l Z d d l Z d d l Z e j Z d Z e j
Z e j � Z
d Z Wn e e f k
r} n Xy1 d d l Z e j Z e j Z e j Z d
Z Wn e e f k
r� n Xd � Z e d k r� d � Z d
� Z nA e d
k rd � Z d � Z n d Z Z Z d � Z d � Z d S( s�
Portable file locking utilities.
Based partially on example by Jonathan Feignberg <jdf@pobox.com> in the Python
Cookbook, licensed under the Python Software License.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
Example Usage::
>>> from django.core.files import locks
>>> with open('./file', 'wb') as f:
... locks.lock(f, locks.LOCK_EX)
... f.write('Django')
t LOCK_EXt LOCK_SHt LOCK_NBt lockt unlocki����Ni t ntt posixc C s t | d � r | j � S| S( sC Get a filedescriptor from something which could be a file or an fd.t fileno( t hasattrR ( t f( ( s9 /tmp/pip-install-XxeQeY/django/django/core/files/locks.pyt fd* s c C s2 t j t | � � } t j | | d d t � d S( Ni i ��( t win32filet _get_osfhandleR
t
LockFileExt __overlapped( t filet flagst hfile( ( s9 /tmp/pip-install-XxeQeY/django/django/core/files/locks.pyR / s c C s/ t j t | � � } t j | d d t � d S( Ni i ��( R R R
t UnlockFileExR ( R R ( ( s9 /tmp/pip-install-XxeQeY/django/django/core/files/locks.pyR 3 s c C s t j t | � | � d S( N( t fcntlt lockfR
( R R ( ( s9 /tmp/pip-install-XxeQeY/django/django/core/files/locks.pyR 7 s c C s t j t | � t j � d S( N( R R R
t LOCK_UN( R ( ( s9 /tmp/pip-install-XxeQeY/django/django/core/files/locks.pyR : s c C s d S( N( ( R R ( ( s9 /tmp/pip-install-XxeQeY/django/django/core/files/locks.pyR A s c C s d S( N( ( R ( ( s9 /tmp/pip-install-XxeQeY/django/django/core/files/locks.pyR D s ( s LOCK_EXs LOCK_SHs LOCK_NBs locks unlock( t __doc__t __all__t Nonet system_typet win32conR t
pywintypest LOCKFILE_EXCLUSIVE_LOCKR R t LOCKFILE_FAIL_IMMEDIATELYR t
OVERLAPPEDR t ImportErrort AttributeErrorR R
R R ( ( ( s9 /tmp/pip-install-XxeQeY/django/django/core/files/locks.pyt <module> s>