I am building a web FTP client using the object model.
Things were going quite well until I discovered that the last few versions of PHP have a bug with both the ftp_rawlist() and ftp_nlist() functions, which return either detailed directory/file listings (ftp_rawlist) or simply a directy/file listing (ftp_nlist) in an array (just trying to be detailed here - most of you know this I'm sure). The bug, simply put, renders these functions useless since they return nothing. About every 20th try they work beautifully.
So, I thought I would try a workaround for this. PHP provides a function much like the system() and exec() functions called ftp_exec() which allows you to execute ftp commands directly on the server. I thought I could get a directory listing this way; however, I can't get it to work. the function takes 2 parameters - the resource stream, and the string command. No mater what I try as the string command I always get the same error: Warning: ftp_exec: 'SITE EXEC (my command)': command not understood. I'm working primarily with a remot Windows_NT ftp server. The basic command to get a directory/file listing is the 'ls' command.
Can anyone give me any suggestions here? I'm at the end of my rope and getting a directory listing is obviously crucial to an ftp client.
Sincerely,
Mark