#23424 [NEW]: fstat() returns different result
| From: | yiwakiri at st dot rim dot or dot jp | Date: | Wed, 30 Apr 2003 05:16:42 +0000 |
| Subject: | #23424 [NEW]: fstat() returns different result | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-38784@lists.php.net to get a copy of this message | ||
From: yiwakiri at st dot rim dot or dot jp
Operating system:
PHP version: 4.3.1
PHP Bug Type: Filesystem function related
Bug description: fstat() returns different result
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 bug report at http://bugs.php.net/?id=23424&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23424&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23424&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23424&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23424&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23424&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23424&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23424&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23424&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23424&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23424&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23424&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23424&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23424&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23424&r=gnused