Bug #14511 Updated: Fstat doesnt work with URLs (http)
| From: | daniel@php.net | Date: | Fri, 14 Dec 2001 11:20:17 +0000 |
| Subject: | Bug #14511 Updated: Fstat doesnt work with URLs (http) | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-73724@lists.php.net to get a copy of this message | ||
ID: 14511
Updated by: daniel
Reported By: mikael@lirbank.com
Status: Bogus
Bug Type: URL related
Operating System: RH7 Apache1.3.22
PHP Version: 4.1.0
New Comment:
Because it isn't /supposed/ to work remotely - actually it's technically impossible to get
this information via HTTP.
That's why it's funny :)
You should make a suggestion to the PHP-Doc team though, to clarify this out in the manual.
Previous Comments:
------------------------------------------------------------------------
[2001-12-14 06:17:19] mikael@lirbank.com
Thanks alot, mfischer, that whas the answer I was looking for (atleast now I know).
I've been asking tons of people about this and no one realy seems to know. but now it's
sorted out.
Thanks!
------------------------------------------------------------------------
[2001-12-14 06:09:18] mfischer@php.net
fstat() only works for local file systems ;)
I will never work on remote files.
------------------------------------------------------------------------
[2001-12-14 05:52:25] mikael@lirbank.com
What is the fun part?
/M
------------------------------------------------------------------------
[2001-12-14 05:48:55] sterling@php.net
LOL.
------------------------------------------------------------------------
[2001-12-14 05:42:19] mikael@lirbank.com
I tried to use FSTAT to get file info about a remote file. If I point to a local file it works but
not on URLs (http).
I believed this was the differendce between FSTAT and STAT (that FSTAT uses file pointers, which in
it's turn supports URLs), otherwise (as I can see it) there is no actual difference between
them.
My installation is a pretty basic RH/Apache/PHP/MySQL set up. Static, not DOA.
Example:
<?php
$xml_file = "http://cws.huginonline.com/S/130062/scor.html";
//$xml_file = "scor.htm";
$fp = fopen( $xml_file, "r" );
$array_fileinfo = fstat ( $fp );
print( "ROWS:" . count( $array_fileinfo ) . "\n" );
print_r( $array_fileinfo );
fclose( $fp );
?>
Above is a not working example, if you change the $xml_file to the local file (commented) it will
work as expected.
Thanks for a GREAT scripting language!
/Mikael Lirbank
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14511&edit=1