You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use portalocker for some system-wide resource management under Windows.
When I run either of the following from two different programs: portalocker.lock(fileHandle, portalocker.LOCK_EX)
Or portalocker.lock(fileHandle, portalocker.LOCK_SH)
I always get the following on the second program:
"LockException: (1, 'The process cannot access the file because another process has locked a portion of the file.')"
My expectation was that exclusive lock is a write lock and the shared lock is a read lock, but instead both:
exhibit exclusive locking in Python
when locked:
can be read from notepad
cannot be written from notepad
cannot be moved from file explorer
The text was updated successfully, but these errors were encountered:
The problem with locking mechanisms is that they need to be implemented in the same way by all participating applications. So the big question is... which locking mechanism is notepad/file explorer using.
Apparently there are multiple locking mechanisms on Windows: #58
Morning!
I am trying to use portalocker for some system-wide resource management under Windows.
When I run either of the following from two different programs:
portalocker.lock(fileHandle, portalocker.LOCK_EX)
Or
portalocker.lock(fileHandle, portalocker.LOCK_SH)
I always get the following on the second program:
"LockException: (1, 'The process cannot access the file because another process has locked a portion of the file.')"
My expectation was that exclusive lock is a write lock and the shared lock is a read lock, but instead both:
The text was updated successfully, but these errors were encountered: