Bug #75538 [NEW]: stream_set_blocking() always returning false for files on windows

From: Date: Sun, 19 Nov 2017 16:39:56 +0000
Subject: Bug #75538 [NEW]: stream_set_blocking() always returning false for files on windows
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212627@lists.php.net to get a copy of this message
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)

« previous php.bugs (#212627) next »