in reply to ftp directories

update: Darn it. I just realized this won't work for you. LIST still seems the best way to do this

stat() and File::stat should be able to help in this regard.

$mode gives type as well as permissions.

Replies are listed 'Best First'.
Re: Re: ftp directories
by mbond (Beadle) on Sep 14, 2001 at 20:29 UTC
    I thought of that, but haven't been able to find a way to run it over the ftp connection.

    if i run it locally (@list = stat(FILEHANDLE);)its gonna give me an error because the file is on the remort server. i would have to run it like @list = stat($ftp->get($filename)); .. but that would cause me to retrieve the file, not what i am looking for.

    According the the Net:FTP docs Stat is the FTP stat command, which returns the server status, not of a specific file. (and its not implimented yet from what i can tell)

    Mbond
      >its gonna give me an error because the file is on the remort server.

      Yes, I realized that too late. Could you try a telnet session to each box instead of FTP?

      update: Assuming that's not feasible, you could do $ftp->cwd($path,$filename) If that succeeds, delete it.