php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21597 Glob doesn't seem to work as expected
Submitted: 2003-01-12 08:18 UTC Modified: 2003-01-27 10:33 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: lucphp at braziliantranslation dot net Assigned:
Status: Closed Package: *Directory/Filesystem functions
PHP Version: 4.3.0 OS: Windows ME
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lucphp at braziliantranslation dot net
New email:
PHP Version: OS:

 

 [2003-01-12 08:18 UTC] lucphp at braziliantranslation dot net
The script example provided in the glob() function page does not work for me, running Windows ME. I tried this simpler test:
        $a = glob ("*.txt");
        print_r ($a);

... and I get an empty array.
Note that the script is in my c:/windows/desktop folder, and I have quite a few text files there.
And if I run:
        $a = glob ("../*.txt");
        print_r ($a);

... I get the correct listing. But since the script is run from c:/windows/desktop, glob ("../*.txt") should produce the listing of my desktop's parent directory, i.e. c:/windows, shouldn't it?

If I state the full path to my desktop, i.e. glob ("c:/windows/desktop/*.txt"), then it works. But that is annoying because whenever I move the script to another directory, I have to change the path manually.

I am using PHP as a scripting language, of course.

Thanks,
Luciano ES
Santos, SP - Brasil

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-25 08:40 UTC] hholzgra@php.net
can you please verify that you are really in the directory you think you are using getcwd()? 

(I wrote glob() in the first place but have no Win system to play with)
 [2003-01-25 11:35 UTC] lucphp at braziliantranslation dot net
Hi.
getcwd() returns "C:\WINDOWS\Desktop
Confirmed.

Luciano ES
Santos, SP - Brasil
 [2003-01-27 10:33 UTC] edink@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot 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 in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 03:01:28 2024 UTC