Class: Net::SFTP::Protocol::V_04::Attributes

Class | Net::SFTP::Protocol::V_04::Attributes
In: | lib/net/sftp/protocol/04/attributes.rb
Parent: | Object

Version 4 of the SFTP protocol made some pretty significant alterations to the File Attributes data type. This encapsulates those changes.

### Methods

buffers buffers empty from_buffer from_hash init new to_s

### Constants

F_SIZE | = | 0x00000001
F_PERMISSIONS | = | 0x00000004
F_ACCESSTIME | = | 0x00000008
F_CREATETIME | = | 0x00000010
F_MODIFYTIME | = | 0x00000020
F_ACL | = | 0x00000040
F_OWNERGROUP | = | 0x00000080
F_SUBSECOND_TIMES | = | 0x00000100
F_EXTENDED | = | 0x80000000
ACL | = | Struct.new( :type, :flag, :mask, :who )
T_REGULAR | = | 1
T_DIRECTORY | = | 2
T_SYMLINK | = | 3
T_SPECIAL | = | 4
T_UNKNOWN | = | 5
T_SOCKET | = | 6
T_CHAR_DEVICE | = | 7
T_BLOCK_DEVICE | = | 8
T_FIFO | = | 9

### Attributes

acl | [RW] |
atime | [RW] |
atime_nseconds | [RW] |
ctime | [RW] |
ctime_nseconds | [RW] |
extended | [RW] |
group | [RW] |
mtime | [RW] |
mtime_nseconds | [RW] |
owner | [RW] |
permissions | [RW] |
size | [RW] |
type | [RW] |

### Public Class methods

buffers()

Return a reference to the buffer factory in use by this class.

empty()

Return an empty Attributes instance.

from_buffer( buffer )

Return an Attributes instance initialized from the given buffer.

from_hash( hash )

Create a new attributes object, initialized from the given hash. The :uid and :gid attributes are treated specially; they are not actually supported by this version of the protocol, but are instead converted by this method to their corresponding names, and assigned (respectively) to :owner and :group.

init( buffers )

An initializer for specifying the buffer factory that should be used by instances of this class.

new( type=T_REGULAR, size=nil, owner=nil, group=nil, permissions=nil, atime=nil, atime_nseconds=nil, ctime=nil, ctime_nseconds=nil, mtime=nil, mtime_nseconds=nil, acl=nil, extended=nil )

Create a new Attributes instance with the given values.

### Public Instance methods

buffers()

A convenience for obtaining a reference to the buffer factory used by this instance‘s class.

to_s()

Convert this object to a string, suitable for inclusion in an SFTP packet (protocol version 4+).

[Validate]