|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-11-19 16:39 UTC] samuel dot chemla at orange dot com
Description: ------------ Tested on PHP 5.6, PHP 7.0.24 & PHP 7.1.11. stream_set_blocking() return always false for files (used with fopen()) on windows. It seems to work on linux. This is related to an old bug marked as "not a bug", but I prefered opening this new one. https://bugs.php.net/bug.php?id=50856 Is this really not a bug? If so, then the doc shoud be updated to clarify why. IMHO this is a bug because non blocking local file streams is a desired feature, even on windows. Use case: dealing with multiple files reading and/or writing in parallel Test script: --------------- $fileRes = fopen("foo.txt", 'wb'); if ($fileRes === false) { throw new Exception(); } var_dump(stream_set_blocking($fileRes, 0)); Expected result: ---------------- bool(true) Actual result: -------------- bool(false) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 16 14:00:01 2025 UTC |
I made a mistake in my previous comment, you must read array(9) { ... 'blocked' => bool(false) ... } (I copied/pasted the result without "n" mode)