|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14511 Fstat doesnt work with URLs (http)
Submitted: 2001-12-14 05:42 UTC Modified: 2001-12-14 06:20 UTC
From: mikael at lirbank dot com Assigned:
Status: Not a bug Package: URL related
PHP Version: 4.1.0 OS: RH7 Apache1.3.22
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
42 - 28 = ?
Subscribe to this entry?

 [2001-12-14 05:42 UTC] mikael at lirbank dot 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.

$xml_file = "";
//$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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-14 05:48 UTC]
 [2001-12-14 05:52 UTC] mikael at lirbank dot com
What is the fun part?
 [2001-12-14 06:09 UTC]
fstat() only works for local file systems ;)

I will never work on remote files.
 [2001-12-14 06:17 UTC] mikael at lirbank dot 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.


 [2001-12-14 06:20 UTC]
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.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 06:01:34 2024 UTC