It appears you are trying to scan/list a remote site's directory;
why? Most sites will not >>allow you to do this. I'm connecting to a remote site via the ftp wrapper. So I can't just use the file path. I have a script which runs on one webserver to get information off another server via ftp. This is the only way the files I need can be retrieved. J.