[RESOLVED] Best way to check whether a file is file or directory when using FTP
I have to loop through a list of directories to look for a file, but I cannot use the filesystem functions because the list is retrieved from an FTP connection and a priori I wouldn't have to know the real path to the file. So, I use ftp_nlist to retrieve an array with all the directories within a relative path, but I only want to do something with the subdirectories: to check whether a file exists within any of them (just one level deep needed), and discard the files and current or parent directories.
As far as I know I cannot use functions like is_dir nor is_file nor file_exists because I can't get the real path (both absolute and relative) to them. I thought on using ftp_size but I'm not sure if it's ok and if there's a better way.