#48365 [Fbk]: glob() function returns empty array

2009-05-28 Thread jani
 ID:   48365
 Updated by:   j...@php.net
 Reported By:  peter dot chen at itg dot com
 Status:   Feedback
 Bug Type: Apache2 related
 Operating System: sparc-sol2.10
 PHP Version:  5.2.9
 New Comment:

Try this on command line:

# php -r 'var_dump(glob(/home/apache/htdocs/testkt/*));'



Previous Comments:


[2009-05-28 16:49:23] j...@php.net

Exactly what Solaris version are you on?
Try this on command line:

# php -r 'var_dump(glob(/home/apache/htdocs/testkt/));'




[2009-05-27 23:05:14] peter dot chen at itg dot com

My apologies, I did not read all the instructions. 

Is there a flag I needed to enable when building php?

As for the code, I mistakenly left the ';' that caused the parse error.
The code should be as follows: 

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
titleglob test/title
/head
body
?
   $path = /home/apache/htdocs/testkt/;
 
print(bglob:/bbrbr);
print_r(glob($path . '*.*'));

print(brbr***brbr);

print(bscandir:/bbrbr);
print_r(scandir($path));
?
/body
/html



[2009-05-23 17:03:08] j...@php.net

You obviously didn't follow the url provided in the email. Please, do 
not Add Comment to your own report, use the Edit Submission (where

the link in the email points too. 

And now, please provide the code that actually causes the problem. That

code works fine everywhere.



[2009-05-23 10:35:41] carsten_sttgt at gmx dot de

 print_r(glob($path . '*.*';));

This line give you a parse error. Must be:
| print_r(glob($path . '*.*'));

Apart from this, the code is working for me (Win,BSD).

BTW:
 [0] = .
 [1] = ..
 [2] = authtest

With your code, this can't be part of the result from glob().

Regards,
Carsten



[2009-05-22 21:09:23] peter dot chen at itg dot com

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
titleglob test/title
/head
body
?
   $path = /home/apache/htdocs/testkt/;
 
print(bglob:/bbrbr);
print_r(glob($path . '*.*';));

print(brbr***brbr);

print(bscandir:/bbrbr);
print_r(scandir($path));
?
/body
/html



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/48365

-- 
Edit this bug report at http://bugs.php.net/?id=48365edit=1



#48365 [Fbk]: glob() function returns empty array

2009-05-23 Thread jani
 ID:   48365
 Updated by:   j...@php.net
 Reported By:  peter dot chen at itg dot com
 Status:   Feedback
 Bug Type: Apache2 related
 Operating System: sparc-sol2.10
 PHP Version:  5.2.9
 New Comment:

You obviously didn't follow the url provided in the email. Please, do 
not Add Comment to your own report, use the Edit Submission (where

the link in the email points too. 

And now, please provide the code that actually causes the problem. That

code works fine everywhere.


Previous Comments:


[2009-05-23 10:35:41] carsten_sttgt at gmx dot de

 print_r(glob($path . '*.*';));

This line give you a parse error. Must be:
| print_r(glob($path . '*.*'));

Apart from this, the code is working for me (Win,BSD).

BTW:
 [0] = .
 [1] = ..
 [2] = authtest

With your code, this can't be part of the result from glob().

Regards,
Carsten



[2009-05-22 21:09:23] peter dot chen at itg dot com

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
titleglob test/title
/head
body
?
   $path = /home/apache/htdocs/testkt/;
 
print(bglob:/bbrbr);
print_r(glob($path . '*.*';));

print(brbr***brbr);

print(bscandir:/bbrbr);
print_r(scandir($path));
?
/body
/html



[2009-05-22 19:43:37] j...@php.net

Please provide proper example script.



[2009-05-22 19:38:20] peter dot chen at itg dot com

Description:

I am trying to use glob() to display the contents of a directory
I store the path in a variable ($path). 

When I give $path as an argument to glob($path), it returns an empty
array.

When I give it to scandir($path), it returns all the files in that
path. 

Reproduce code:
---
---
From manual page: function.glob
---


Expected result:

Array ( [0] = . [1] = .. [2] = authtest [3] = globtest.php [4] =
globtest.php.LCK [5] = globtest2.php [6] = home.php.LCK ) 

Actual result:
--
Array ( ) 






-- 
Edit this bug report at http://bugs.php.net/?id=48365edit=1