#23424 [Opn->Bgs]: fstat() returns different result
| From: | wez@php.net | Date: | Wed, 30 Apr 2003 09:22:01 +0000 |
| Subject: | #23424 [Opn->Bgs]: fstat() returns different result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-38792@lists.php.net to get a copy of this message | ||
ID: 23424
Updated by: wez@php.net
Reported By: yiwakiri at st dot rim dot or dot jp
-Status: Open
+Status: Bogus
Bug Type: Filesystem function related
PHP Version: 4.3.1
New Comment:
Pipes/FIFOs have neither a size nor can they been seeked.
This is expected behaviour; not a bug in PHP so marking it as bogus.
Previous Comments:
------------------------------------------------------------------------
[2003-04-30 00:16:42] yiwakiri at st dot rim dot or dot jp
Hi,
fstat() returns different results, in PIPE and REDIRECT.
I wrote Following script as both PIPE and REDIRECT
sample.php:
<?PHP
$stat = fstat(STDIN);
if ($stat['size'] > 0) {
echo fread(STDIN, $stat['size']);
else {
echo "STDIN is empty.\n";
}
}
?>
$ cat sample.php | php sample.php
In this case, The result was a disappointment.
$ php sample.php < sample.php
In this case, I obtained satisfactory results.
fstat() result is diffrent.
For PIPE,
$stat['size'] = 0 // at any time
For REDIRECT
$stat['size'] = `actual size'
Is this specifications ?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23424&edit=1