Bug #75538 [NEW]: stream_set_blocking() always returning false for files on windows
From: samuel dot chemla at orange dot com
Operating system: Windows
PHP version: 7.1.11
Package: Streams related
Bug Type: Bug
Bug description:stream_set_blocking() always returning false for files on windows
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)
--
Edit bug report at https://bugs.php.net/bug.php?id=75538&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75538&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75538&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75538&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75538&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75538&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75538&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75538&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75538&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75538&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75538&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75538&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75538&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75538&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75538&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75538&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75538&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75538&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75538&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75538&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75538&r=mysqlcfg
Thread (13 messages)
- samuel dot chemla at orange dot com
- ab@php.netBug #75538 [Opn->Fbk]: stream_set_blocking() always returning false for files on windows
- samuel dot chemla at orange dot comBug #75538 [Fbk->Opn]: stream_set_blocking() always returning false for files on windows
- samuel dot chemla at orange dot comBug #75538 [Opn]: stream_set_blocking() always returning false for files on windows
- ab@php.netBug #75538 [Opn]: stream_set_blocking() always returning false for files on windows
- samuel dot chemla at orange dot comBug #75538 [Opn]: stream_set_blocking() always returning false for files on windows
- mattficken@php.netBug #75538 [Com]: stream_set_blocking() always returning false for files on windows
- ab@php.netBug #75538 [Opn->Csd]: stream_set_blocking() always returning false for files on windows
- samel dot chemla at orange dot comBug #75538 [Com]: stream_set_blocking() always returning false for files on windows
- samuel dot chemla at orange dot comBug #75538 [Csd->Asn]: stream_set_blocking() always returning false for files on windows
- requinix@php.netBug #75538 [Asn->Csd]: stream_set_blocking() always returning false for files on windows
- samuel dot chemla at orange dot comBug #75538 [Csd]: stream_set_blocking() always returning false for files on windows
- requinix@php.netBug #75538 [Csd]: stream_set_blocking() always returning false for files on windows