Class: Net::SFTP::Protocol::V_01::Attributes

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

A class representing the attributes of a file or directory on the server. It may be used to specify new attributes, or to query existing attributes.

### Methods

buffers buffers empty from_buffer from_hash init new to_s

### Constants

F_SIZE | = | 0x00000001
F_UIDGID | = | 0x00000002
F_PERMISSIONS | = | 0x00000004
F_ACMODTIME | = | 0x00000008
F_EXTENDED | = | 0x80000000

### Attributes

atime | [RW] |
extended | [RW] |
gid | [RW] |
mtime | [RW] |
permissions | [RW] |
size | [RW] |
uid | [RW] |

### Public Class methods

buffers()

Returns the buffer factory for this class.

empty()

Create a new, empty Attributes object.

from_buffer( buffer )

Create a new Attributes object, initialized from the given buffer.

from_hash( hash )

Create a new attributes object, initialized from the given hash. The :owner and :group 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 id numbers, and assigned (respectively) to :uid and :gid.

init( buffers )

An initialization routine, to grant the class (factory) access to a buffer factory. The buffer factory is used by the class’ to_s method to encode the object‘s attributes.

This returns `self`, making it suitable for chaining.

new( size=nil, uid=nil, gid=nil, permissions=nil, atime=nil, mtime=nil, extended=nil )

Create a new Attributes with the given attributes.

### Public Instance methods

buffers()

Returns the buffer factory for the object‘s class.

to_s()

Convert the object to a string suitable for passing in an SFTP packet.

[Validate]