|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-04-30 04:22 UTC] wez@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 18:00:01 2025 UTC |
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 ?