in reply to Re: Net::FTP file type and attributes
in thread Net::FTP file type and attributes

Hi, thanks for your reply.

The $filename should be a simple entry like a file or directory. I need check only for one entry, not for all directory content.

Futhermore, the $ftp->dir return different content according to FTP server. For example, the following commands return the same result:

$ftp->dir("/a/real/empty/directory");
$ftp->dir("/unexistent/directory/");

I think the solution is more complex. :(

Thank you anyway.
  • Comment on Re: Re: Net::FTP file type and attributes

Replies are listed 'Best First'.
Re: Re: Re: Net::FTP file type and attributes
by flyingmoose (Priest) on Jan 23, 2004 at 01:55 UTC

    No it's not more complex, you just won't listen to reason :)

    If you start checking those directories from an FTP root, you will be able to check by descending that directory root whether /nonexistant/directory actually exists. Namely, "nonexistant" will not exist in the directory root. I'm speaking algorithmically here, as you have an algorithmic problem, not a Perl module problem.

    As for the dir format being inconsistant between servers, any server should include enough for you to regex the beast and tell whether you have a directory or a file. Such is a limitation in FTP, not neccessarily in the Perl module. Dir is only a command that returns text, by definition of FTP. If this really bugs you, try an SFTP module.