PHP 4.0 Bug #7094 Updated: fstat() returns an empty array

From: Date: Wed, 11 Oct 2000 13:55:32 +0000
Subject: PHP 4.0 Bug #7094 Updated: fstat() returns an empty array
Groups: php.dev 
Request: Send a blank email to php-dev+get-34672@lists.php.net to get a copy of this message
ID: 7094 Updated by: stas Reported By: doc@kadath.org Status: Feedback Bug Type: Filesystem function related Assigned To: Comments: Cannot reproduce on current CVS. What was the value of $filename? What was the $fp (try var_dump($fp)) What is the result of var_dump($fstats) after fstat? Previous Comments: --------------------------------------------------------------------------- [2000-10-09 01:25:22] doc@kadath.org I could be wrong, but it appears that fstat($fp) returns an array of nulls instead of an array of file stats. See the following code: $fp = fopen($filename, "r"); $fstats = fstat($fp); for($i=0; $i<14; $i++) { $len=strlen($fstats[i]); echo "fstats $i: $fstats[$i] / len=$len<br>n"; } echo "fstat() with bogus pointer: ".fstat($bogusfp); ---------------- This is the output: fstats 0: / len=0 fstats 1: / len=0 fstats 2: / len=0 fstats 3: / len=0 fstats 4: / len=0 fstats 5: / len=0 fstats 6: / len=0 fstats 7: / len=0 fstats 8: / len=0 fstats 9: / len=0 fstats 10: / len=0 fstats 11: / len=0 fstats 12: / len=0 fstats 13: / len=0 Warning: Supplied argument is not a valid File-Handle resource in /home/mentat/public_html/dom-functions.php on line 23 fstat() with bogus pointer: --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7094

« previous php.dev (#34672) next »