php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16875 FILE Function Checks Wrong Path
Submitted: 2002-04-27 13:12 UTC Modified: 2002-07-02 22:47 UTC
Votes:2
Avg. Score:3.0 ± 2.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: tonicpeddler at cs dot com Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.2.0 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tonicpeddler at cs dot com
New email:
PHP Version: OS:

 

 [2002-04-27 13:12 UTC] tonicpeddler at cs dot com
When I call:

$data = file( "database.txt" );

From my file "c:\xitami\webpages\db\database.php", php doesn't check "c:\xitami\webpages\db\" for database.txt, instead it returns an error saying that "database.txt" doesn't exist in the directory "c:\xitami\webpages\db\database.php"  I beleive this may be a bug, since it shouldn't be including the name of the php script in the directory.  In the mean time I am specifying an absolute filename for database.txt, however I'd much prefer the modularity of relative file access.

If you fix it, that's great, I hope someone contacts me.  In that case could someone tell me where to download a prebuilt binary?  I'm on dialup and a pretty slow machine, not very interested in downloading the source code again, and building, again.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-27 19:35 UTC] sniper@php.net
Can you test if the same thing happens with include() ?

 [2002-04-27 19:47 UTC] tonicpeddler at cs dot com
I use include() and require() all the time, it works just fine.  So the problem is probably specific to file()
 [2002-04-29 11:58 UTC] tonicpeddler at aol dot com
I looked through some of the PHP scripts I had written, and found a working example of fopen that works just fine using a relative file path.  Pertinent exerpt:

	$log = fopen('log.txt', 'a');
	fwrite($log, $text . "\n");
	fclose($log);
	echo ' <a href="log.txt">View Log</a>';

Is this bug being dealt with?
 [2002-05-02 13:16 UTC] tonicpeddler at aol dot com
I'm gonna go out a limb here and guess that this bug is no longer being looked into.  If it's not, someone should kindly take the time to contradict me...
 [2002-05-06 08:40 UTC] tonicpeddler at aol dot com
IS THIS BUG GETTING ANY ATTENTION?  I'D CONTRIBUTE SOME WORK TO PHP AND FIND THE BUG MYSELF BUT I DO NOT HAVE THE TIME TO DO SO!
 [2002-05-06 08:49 UTC] wez@php.net
Please be patient: we don't have much time either.
 [2002-05-06 08:55 UTC] derick@php.net
I suggest changing your attitude:

http://www.jdimedia.nl/derick/20020502.php

Derick
 [2002-05-06 08:59 UTC] tonicpeddler at aol dot com
I just wanted some assurance that this bug hadn't somehow fallen between the cracks.  I'd asked 4 days earlier for someone to just tell me that it hadn't done just that, and when no one did, I posted w/CAPS, just trying to make sure it was being seen.  Change my attitude?  I got the exact reaction I wanted, assurance it was being seen.  I know this bug isn't a real big deal, and I'm not angry.  I was just trying to get your attention.
 [2002-05-06 09:05 UTC] jan@php.net
May I visit you and scream right in your face all the time, just to make sure I get your attention, though you are at work? 
 [2002-05-06 09:07 UTC] tonicpeddler at aol dot com
Though I refuse to continue this discussion about my attitude any further than this, I'll say that screaming in your face is a far cry from typing in capital letters
 [2002-07-02 22:47 UTC] sniper@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC