Class: Net::SFTP::Protocol::V02::Base

Inherits:
Net::SFTP::Protocol::V01::Base show all
Defined in:
lib/net/sftp/protocol/02/base.rb

Overview

Wraps the low-level SFTP calls for version 2 of the SFTP protocol.

None of these protocol methods block–all of them return immediately, requiring the SSH event loop to be run while the server response is pending.

You will almost certainly never need to use this driver directly. Please see Net::SFTP::Session for the recommended interface.

Direct Known Subclasses

Net::SFTP::Protocol::V03::Base

Constant Summary

Constants included from Constants::PacketTypes

Constants::PacketTypes::FXP_ATTRS, Constants::PacketTypes::FXP_BLOCK, Constants::PacketTypes::FXP_CLOSE, Constants::PacketTypes::FXP_DATA, Constants::PacketTypes::FXP_EXTENDED, Constants::PacketTypes::FXP_EXTENDED_REPLY, Constants::PacketTypes::FXP_FSETSTAT, Constants::PacketTypes::FXP_FSTAT, Constants::PacketTypes::FXP_HANDLE, Constants::PacketTypes::FXP_INIT, Constants::PacketTypes::FXP_LINK, Constants::PacketTypes::FXP_LSTAT, Constants::PacketTypes::FXP_MKDIR, Constants::PacketTypes::FXP_NAME, Constants::PacketTypes::FXP_OPEN, Constants::PacketTypes::FXP_OPENDIR, Constants::PacketTypes::FXP_READ, Constants::PacketTypes::FXP_READDIR, Constants::PacketTypes::FXP_READLINK, Constants::PacketTypes::FXP_REALPATH, Constants::PacketTypes::FXP_REMOVE, Constants::PacketTypes::FXP_RENAME, Constants::PacketTypes::FXP_RMDIR, Constants::PacketTypes::FXP_SETSTAT, Constants::PacketTypes::FXP_STAT, Constants::PacketTypes::FXP_STATUS, Constants::PacketTypes::FXP_SYMLINK, Constants::PacketTypes::FXP_UNBLOCK, Constants::PacketTypes::FXP_VERSION, Constants::PacketTypes::FXP_WRITE

Instance Attribute Summary

Attributes inherited from Base

#session

Instance Method Summary collapse

Methods inherited from Net::SFTP::Protocol::V01::Base

#block, #close, #fsetstat, #fstat, #link, #lstat, #mkdir, #open, #opendir, #parse_attrs_packet, #parse_data_packet, #parse_handle_packet, #parse_name_packet, #parse_status_packet, #read, #readdir, #readlink, #realpath, #remove, #rmdir, #setstat, #stat, #symlink, #unblock, #write

Methods inherited from Base

#initialize, #parse

Constructor Details

This class inherits a constructor from Net::SFTP::Protocol::Base

Instance Method Details

#rename(name, new_name, flags = nil) ⇒ Object

Sends a FXP_RENAME packet to the server to request that the file or directory with the given name (must be a full path) be changed to new_name (which must also be a path). The flags parameter is ignored in this version of the protocol.



25
26
27
# File 'lib/net/sftp/protocol/02/base.rb', line 25

def rename(name, new_name, flags=nil)
  send_request(FXP_RENAME, :string, name, :string, new_name)
end

#versionObject

Returns the protocol version implemented by this driver. (2, in this case)



17
18
19
# File 'lib/net/sftp/protocol/02/base.rb', line 17

def version
  2
end