Re: glob(path_pattern, GLOB_ONLYDIR)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That nailed my problem.  GLOB_ONLYDIR is a defined constant. It echos as 8192.

I inadvertently treated it as a string with quotes, which I didn't include in my original post.

I had forgotten that most function flags are simply constants which can be tested for and printed, etc.

Many thanks....

Jim Lucas wrote:
Al wrote:
I thought the "." had meaning since the manual user notes used it

Definitely, my php is version 4.4.4; it's on a virtual host.

I found the glob file for the GNU C Library and GLOB_ONLYDIR doesn't seem to be defined correctly, the file appears to rather old.


echo GLOB_ONLYDIR;

does this work?


I used the numerical value "8196" and it works fine. I'm a little reluctant to use the numerical value as I want my code to be generally universal. Maybe the numerical value is safer anyhow. What do you think?

I can alternatively just filter out the files in a second step.

Al.............



Jim Lucas wrote:
Al wrote:
I can't use flag "GLOB_ONLYDIR" to work on a Linux, php4.4.4. I only want the dirs.

This works; sort of:
print_r(glob('../*',)); //It lists all the files AND directories. Yet it seems to ignore the lack of ".*" and finds xxx.yyy. That's OK, I can delete the files
remember this is linux you are talking about, not windows.

A '*' means anything, including a '.'



This fails:
print_r(glob('../*', GLOB_ONLYDIR));
well, double check your php version, because this should be built in whit the version that you are running.


And I get: "Warning: glob() expects parameter 2 to be long, string given in foo"

I can't find anything in the manual or when Googling.

Anyone can explain this for me?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux