Reply to is_file under windows

Your name:

Reply:


Posted by Tyno Gendo on 04/10/07 16:23

How do you normally check filetypes? I ended up resorting to
!is_dir($file) as all other calls seem to fail so I had to assume if not
a directory its a file, rather than specifically checking if its a file.

I'm recursing a folder:

<?php
$cat_seq = 1;
$path = "e:\\videos\\$cat_seq";
$dh = opendir($path);
while ($file = readdir($dh)) {
echo filetype($file)."<br />";
if ( !is_dir($file) ) {
echo $file;
}
}
?>

Under windows, I can try is_file(), this always returns "" (nothing),
and if I try filetype($file) (as above on the echo) I can get 'dir' for
directories but get the following for files:

Warning: filetype() [function.filetype]: Lstat failed for <filename>

[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

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