Reply to Re: is_file under windows (SOLVED)

Your name:

Reply:


Posted by Tyno Gendo on 04/11/07 08:18

Willem Bogaerts wrote:
>> .. I just uploaded to a linux server to test, same result. Files exist
>> because i'm just recursing a directory now and printing out the names of
>> things that it finds along with an is_file($file) as well, always
>> returns <blank> :-/
>
>
> What do you pass to the is_file() function? The full path or just the
> "basename"?
>

Thanks Willem,

I changed the test code as follows and used chdir to move into the base
directory first, then I just opened "." as the directory and checked the
file, it works. Code as follows checking for video files in a category
folder:

<?php
$cat_seq = 1;
$path = "e:\\videos\\$cat_seq";
chdir($path);
$dh = opendir(".") or die('cannot open directory');
while ($file = readdir($dh)) {
if ( is_file($file) ) {
echo $file;
}
}
?>

[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

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