$sftp->do_lstat($path)
$sftp->do_fstat($handle)
$sftp->do_stat($path)
methods. There may be other solutions/modules, but I'm quite confident these would work for you... | [reply] [d/l] |
Hi,
there is a File::Remote module. It does not offer a stat function or the -d ... operators, but might at least give you some kind of access to the file system on the other box.
You could try to open() the remote entity - if you can, it's a file, otherwise you will at least get an error message that you might be able to catch and proceed accordingly.
Update: In contrary to Net::SFTP, File::Remote uses ssh or rsh which is usually available whereas ++blazar's solution would require an SFTP server to connect to. On the other hand, his solution already provides functions for the test you require.
Regards,
svenXY | [reply] |