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
# [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
# [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
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
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
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]))
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()
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
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
9 matches
Mail list logo