Re: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-23 Thread clive
try using this, from php manual, clive ?php echo filetype('/etc/passwd'); // file echo filetype('/etc/');// dir ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-23 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-22 23:26:06 -0800: On Jan 22, 2007, at 10:20 PM, Chris wrote: $basedir = '/whatever'; for($i = 0; $i count($cont); $i++) { $fullpath = $basedir . '/' . $cont[$i]; if (is_file($fullpath)) { . } Ok, I hope I can get this to work. The code I

Re: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-23 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-23 09:14:15 +: readdir() returns only a basename, you need to be in the directory you're traversing (opendir(.) or opendir($dir); chdir($dir)) ... or prefix the basenames with the path you used in the opendir() call. -- How many Vietnam vets does it take to

Re: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-23 Thread jekillen
On Jan 22, 2007, at 11:18 PM, clive wrote: everything without an extension is a directory You will notice that the only directory detected by this code is templates. There are no files detected by this code. Does this have something to do with stat cache? I want to make one array with

Re: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-23 Thread Richard Lynch
On Tue, January 23, 2007 12:03 am, jekillen wrote: Hello php developers: I am having a problem with the following code: OS: FreeBSD v6.0 Apache 1.3.34 php 5.1.2 - $cont is an array produced from opening and reading a directory: for($i = 0; $i count($cont); $i++) { print

Re: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-22 Thread Chris
jekillen wrote: Hello php developers: I am having a problem with the following code: OS: FreeBSD v6.0 Apache 1.3.34 php 5.1.2 - $cont is an array produced from opening and reading a directory: for($i = 0; $i count($cont); $i++) { print $cont[$i].'br'; if(is_file($cont[$i]))

RE: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-22 Thread Ligaya A. Turmelle
Haven't really looked at it - but elseif is one word - or do you mean else then an if... Respectfully, Ligaya Turmelle -Original Message- From: jekillen [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 23, 2007 4:03 PM To: PHP General List Subject: [PHP] having trouble with is_file()

Re: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-22 Thread clive
everything without an extension is a directory You will notice that the only directory detected by this code is templates. There are no files detected by this code. Does this have something to do with stat cache? I want to make one array with directories and one array with files. I can't see

Re: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-22 Thread jekillen
On Jan 22, 2007, at 10:20 PM, Chris wrote: jekillen wrote: Hello php developers: I am having a problem with the following code: OS: FreeBSD v6.0 Apache 1.3.34 php 5.1.2 - $cont is an array produced from opening and reading a directory: for($i = 0; $i count($cont); $i++) { print