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
Hello, when I acquire a lock using lock->acquire on a file, I can't open/read the file even in the same php script. How can I read the file while I have acquired a lock on it?
The text was updated successfully, but these errors were encountered:
Sorry for late reply - for some reason didn't received notification to my mailbox.
What you're saying is very strange, because this lib uses flock which provides, quoting:
advisory file locking which means all accessing programs have to use the same way of locking or it will not work
and also it means that lock is informative, not restrictive. So even if it's "locked" it could be read/written by anybody who doesn't want to respect locking. As you can see, you should always be able to read "locked" file same way as if it's not "locked". Basically "lock" is a way to communicate between separate and independent processes and share resources(files in this case) which can be used only in "single-threaded" mode. Most common case is you want to allow only one script/process to be able to write to the file at a time, and any amount of scripts/processes to be able to read from the file.
If you can reproduce it on a stable basis, could you please provide context(OS, PHP version, file system and so on), so I could reproduce it and investigate?
Hello, when I acquire a lock using lock->acquire on a file, I can't open/read the file even in the same php script. How can I read the file while I have acquired a lock on it?
The text was updated successfully, but these errors were encountered: