A question about flock
| From: | Gaetano Giunta | Date: | Tue, 29 Sep 2009 15:48:32 +0000 |
| Subject: | A question about flock | ||
| Groups: | php.internals.win | ||
| Request: | Send a blank email to internals-win+get-623@lists.php.net to get a copy of this message | ||
From the flock man page:
[snip]
- Parameters
-- operation
--- LOCK_NB if you don't want flock() to block while locking. (not supported on Windows)
But in win32/flock.c, the LOCK_NB flag is turned in LOCKFILE_FAIL_IMMEDIATELY
From the LockFileEx man page (http://msdn.microsoft.com/en-us/library/aa365203%28VS.85%29.aspx):
"If the file handle was not opened for asynchronous I/O and the lock is not available, this call waits until the lock is granted or an error occurs, unless the LOCKFILE_FAIL_IMMEDIATELY flag is specified"
Since I see no trace of FILE_FLAG_OVERLAPPED in the win32 dir, i suppose async IO is not used in php, hence the LOCK_NB should actually work.
Is this correct or am I missing something?
I might of course test on my machine, but I might be missing some weird os/fs combo where the results are different.
Thanks
Gaetano
PS: while at it, one more question - is LockFileEx supported transparently over smb?