Reply to opendir and current path problem ?

Your name:

Reply:


Posted by gnah on 08/23/05 17:24

Greetings,

I hope my problem is easy to fix, I'm pretty new with php - but I am
getting weird results with the opendir() function. It may just be a
path problem, but I don't see which variable to change.

here are some tests I did to see what was wrong:

$blah = opendir("blocks");
while ($file = readdir($blah)) {
writelog("$file", DEBUG);
}

$blah = opendir("modules");
while ($file = readdir($blah)) {
writelog("$file", DEBUG);
}

$blah = opendir("images");
while ($file = readdir($blah)) {
writelog("$file", DEBUG);
}


In the 1st and 3rd while()'s, it correctly picks the "blocks" and
"images" directories of my doc_root path (which is the path I get when
I try a getcwd()). However, the second while() lists me the files
contained in the "modules" directory of my server root (apache's
modules directory) instead of picking the "modules" directory in the
current dir. (both apache and the doc_root contain a 'modules'
directory). I know I could probably get around the problem using full
paths, but this is from phpnuke, so I'd like to keep the original code
intact and would prefer changing a config somewhere if possible.

Note that the very same server configuration on a win2k or on a winxp
do not give this problem, so I'm guessing it's a NT-related problem.
It's as if it's checking a list of directories in a path instead of
the current directory and the server_root happens to come before
doc_root.

Bug or feature ? Configuration problem ?


Thanks

FP

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация