Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jdavidb (1361)

jdavidb
  (email not shown publicly)
http://voiceofjohn.blogspot.com/

J. David Blackstone has a Bachelor of Science in Computer Science and Engineering and nine years of experience at a wireless telecommunications company, where he learned Perl and never looked back. J. David has an advantage in that he works really hard, he has a passion for writing good software, and he knows many of the world's best Perl programmers.

Journal of jdavidb (1361)

Friday December 02, 2005
05:25 PM

Net::SFTP::Foreign

[ #27838 ]

I needed an API to drive an SFTP session. For political reasons, I am more or less limited on this server to perl5.6.1. I've been unable to get Net::SSH::Perl up and running in that environment, and thus Net::SFTP would not work.

However, Net::SFTP::Foreign now exists, which provides an API to drive SFTP using the OpenSSH sftp binary. Coolness!

The module does more or less just what I need. There is a little bit of brain-deadness. I cursed this at first, then found that each instance of brain-deadness originated in Net::SFTP, of which Net::SFTP::Foreign is a fork.

The most eggregious problem is there does not seem to be a way to change the current working directory. However, I can't seem to find one in Net::SFTP, either, so I can hardly fault the author of this fork.

Other problems are that the ls method doesn't simply get a directory listing of the current working directory if you call it with no parameters. You have to pass it ".". The documentation is less than helpful here, because it simply indicates that there's a mandatory parameter named $remote and describes the method as "Fetches a directory listing of $remote." Well, what is $remote? Why don't you tell me, or at least name it something more descriptive? Turns out it means "the remote directory," and it was named analogously to the get and put methods, which specify the local and remote filenames.

All in all, excellent work making this module work. I owe Salvador Fandiño a non-alcoholic beverage of his choice if he's ever out my way.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.