0
+* http://net-ssh.rubyforge.org/sftp
0
+Net::SFTP is a pure-Ruby implementation of the SFTP protocol (specifically, versions 1 through 6 of the SFTP protocol). Note that this is the "Secure File Transfer Protocol", typically run over an SSH connection, and has nothing to do with the FTP protocol.
0
+* Transfer files or even entire directory trees to or from a remote host via SFTP
0
+* Completely supports all six protocol versions
0
+* Asynchronous and synchronous operation
0
+* Read and write files using an IO-like interface
0
+ Net::SFTP.start('host', 'username', :password => 'password') do |sftp|
0
+ # upload a file or directory to the remote host
0
+ sftp.upload!("/path/to/local", "/path/to/remote")
0
+ # download a file or directory from the remote host
0
+ sftp.download!("/path/to/remote", "/path/to/local")
0
+ # grab data off the remote host directly to a buffer
0
+ data = sftp.download!("/path/to/remote")
0
+ # open and write to a pseudo-IO for a remote file
0
+ sftp.file.open("/path/to/remote", "w") do |f|
0
+ f.puts "Hello, world!\n"
0
+ # open and read from a pseudo-IO for a remote file
0
+ sftp.file.open("/path/to/remote", "r") do |f|
0
+ sftp.mkdir! "/path/to/directory"
0
+ # list the entries in a directory
0
+ sftp.dir.foreach("/path/to/directory") do |entry|
0
+For the full documentation, start with Net::SFTP::Session. Also see Net::SFTP::Operations::Upload, Net::SFTP::Operations::Download, Net::SFTP::Operations::FileFactory, Net::SFTP::Operations::File, and Net::SFTP::Operations::Dir.
0
+If you wish to run the tests, you'll need:
0
+* Echoe (if you want to use the Rakefile)
0
+* gem install net-sftp (might need sudo privileges)
0
+Or, if you prefer to do it the hard way (sans Rubygems):
0
+* tar xzf net-ssh-*.tgz
0
+* ruby setup.rb install (might need sudo privileges)
0
+Copyright (c) 2008 Jamis Buck <jamis@37signals.com>
0
+Permission is hereby granted, free of charge, to any person obtaining
0
+a copy of this software and associated documentation files (the
0
+'Software'), to deal in the Software without restriction, including
0
+without limitation the rights to use, copy, modify, merge, publish,
0
+distribute, sublicense, and/or sell copies of the Software, and to
0
+permit persons to whom the Software is furnished to do so, subject to
0
+the following conditions:
0
+The above copyright notice and this permission notice shall be
0
+included in all copies or substantial portions of the Software.
0
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
0
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
0
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
0
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
0
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
0
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Comments
No one has commented yet.