Class | Net::SFTP::Protocol::V_01::Impl |
In: |
lib/net/sftp/protocol/01/impl.rb
|
Parent: | Object |
The implementing class for version 1 of the SFTP protocol. It implements the various operations and callbacks available to this level of the protocol. Other protocol versions will typically extend this class, adding (or modifying) methods as needed to bring the implementation into sync with the needed version.
Name | = | Struct.new( :filename, :longname, :attributes ) |
F_READ | = | 0x00000001 |
F_WRITE | = | 0x00000002 |
F_APPEND | = | 0x00000004 |
F_CREAT | = | 0x00000008 |
F_TRUNC | = | 0x00000010 |
F_EXCL | = | 0x00000020 |
open | -> | open_raw |
stat | -> | stat_raw |
lstat | -> | lstat_raw |
fstat | -> | fstat_raw |
close | -> | close_handle |
attr_factory | [R] | The attribute-factory used by this dispatcher. |
driver | [R] | The protocol driver that drives this dispatcher. |
extensions | [RW] | The protocol extensions specified when the protocol version was negotiated. |
Create a new instance using the given protocol driver, packet assistant, and attributes factory.
A helper method for defining new operations supported by this implementation. This will create one method for each named operation. By default, the method simply formats the packet (using the packet assistant), and then sends the data via the driver. It will then return the request id used for this operation.
Used internally to handle attrs packets. The on_attrs callback is invoked, if registered, with the driver, id, and attribute object.
Used internally to handle data packets. The on_data callback is invoked, if registered, with the driver, id, and data (as a buffer).
Used internally to handle handle packets. The on_handle callback is invoked, if registered, with the driver, id, and handle.
Used internally to handle name packets. The on_name callback is invoked, if registered, with the driver, id, and array of items.
Used internally to handle status packets. The on_status callback is invoked, if registered, with the driver, id, and code.