I have function below to check if specific item is directory or file:
private function isDir($dir)
{
if ( @ftp_chdir($this->connected, $dir) === true )
{
ftp_chdir($this->connected, '..');
return true;
}
else
{
return false;
}
}
It detects correctly but even if I put @ before error I always get the same error:
WARNING: [2] - ftp_chdir() [function.ftp-chdir]: CWD failed. "/someDIR/someFile.xls": directory not found. in file: D:\www\testiranje\epg\classes\ftpClass.php - line 147
I know that error is more than expected, but that is the best way I figured out to detect if some item is dir or not …
Thanks for your help!
use is_dir like :