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

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

Overview

Wraps the low-level SFTP calls for version 3 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::V04::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::V02::Base

#rename

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, #realpath, #remove, #rename, #rmdir, #setstat, #stat, #unblock, #write

Methods inherited from Base

#initialize, #parse

Constructor Details

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

Instance Method Details

Sends a FXP_READLINK packet to the server to request that the target of the given symlink on the remote host (path) be returned.



23
24
25
# File 'lib/net/sftp/protocol/03/base.rb', line 23

def readlink(path)
  send_request(FXP_READLINK, :string, path)
end

Sends a FXP_SYMLINK packet to the server to request that a symlink at the given path be created, pointing at target..



29
30
31
# File 'lib/net/sftp/protocol/03/base.rb', line 29

def symlink(path, target)
  send_request(FXP_SYMLINK, :string, path, :string, target)
end

#versionObject

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



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

def version
  3
end