Class: Net::SFTP::Protocol::V04::Attributes

### Home Classes Methods

### In Files

- lib/net/sftp/protocol/04/attributes.rb

### Parent

Net::SFTP::Protocol::V01::Attributes

### Methods

- ::new

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Net
- Net::SFTP
- Net::SFTP::Constants
- Net::SFTP::Constants::ACE
- Net::SFTP::Constants::ACE::Flag
- Net::SFTP::Constants::ACE::Mask
- Net::SFTP::Constants::ACE::Type
- Net::SFTP::Constants::LockTypes
- Net::SFTP::Constants::OpenFlags
- Net::SFTP::Constants::OpenFlags::FV1
- Net::SFTP::Constants::OpenFlags::FV5
- Net::SFTP::Constants::OpenFlags::FV6
- Net::SFTP::Constants::PacketTypes
- Net::SFTP::Constants::RenameFlags
- Net::SFTP::Constants::StatusCodes
- Net::SFTP::Exception
- Net::SFTP::Operations
- Net::SFTP::Operations::Dir
- Net::SFTP::Operations::Download
- Net::SFTP::Operations::File
- Net::SFTP::Operations::FileFactory
- Net::SFTP::Operations::Upload
- Net::SFTP::Packet
- Net::SFTP::Protocol
- Net::SFTP::Protocol::Base
- Net::SFTP::Protocol::V01
- Net::SFTP::Protocol::V01::Attributes
- Net::SFTP::Protocol::V01::Base
- Net::SFTP::Protocol::V01::Name
- Net::SFTP::Protocol::V02
- Net::SFTP::Protocol::V02::Base
- Net::SFTP::Protocol::V03
- Net::SFTP::Protocol::V03::Base
- Net::SFTP::Protocol::V04
- Net::SFTP::Protocol::V04::Attributes
- Net::SFTP::Protocol::V04::Base
- Net::SFTP::Protocol::V04::Name
- Net::SFTP::Protocol::V05
- Net::SFTP::Protocol::V05::Base
- Net::SFTP::Protocol::V06
- Net::SFTP::Protocol::V06::Attributes
- Net::SFTP::Protocol::V06::Base
- Net::SFTP::Request
- Net::SFTP::Response
- Net::SFTP::Session
- Net::SFTP::StatusException
- Net::SFTP::Version
- Net::SSH
- Net::SSH::Connection
- Net::SSH::Connection::Session

No matching classes.

# Net::SFTP::Protocol::V04::Attributes

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. This particular class is specific to versions 4 and 5 of the SFTP protocol.

To specify new attributes, just pass a hash as the argument to the constructor. The following keys are supported:

- :type | the type of the item (integer, one of the T_ constants)

- :size | the size of the item (integer)

- :uid | the user-id that owns the file (integer)

- :gid | the group-id that owns the file (integer)

- :owner | the name of the user that owns the file (string)

- :group | the name of the group that owns the file (string)

- :permissions | the permissions on the file (integer, e.g. 0755)

- :atime | the access time of the file (integer, seconds since epoch)

- :atime_nseconds | the nanosecond component of atime (integer)

- :createtime | the time at which the file was created (integer, seconds since epoch)

- :createtime_nseconds | the nanosecond component of createtime (integer)

- :mtime | the modification time of the file (integer, seconds since epoch)

- :mtime_nseconds | the nanosecond component of mtime (integer)

- :acl | an array of ACL entries for the item

- :extended | a hash of name/value pairs identifying extended info

Likewise, when the server sends an Attributes object, all of the above attributes are exposed as methods (though not all will be set with non-nil values from the server).

### Constants

ACL

  A simple struct for representing a single entry in an Access Control List. (See Net::SFTP::Constants::ACE)

F_ACCESSTIME
F_ACL
F_CREATETIME
F_MODIFYTIME
F_OWNERGROUP
F_SUBSECOND_TIMES

### Attributes

acl[RW]

The array of access control entries for this item.

atime_nseconds[RW]

The nanosecond component of the access time.

createtime[RW]

The creation time of the remote item, in seconds since the epoch.

createtime_nseconds[RW]

The nanosecond component of the creation time.

group[W]

The group of the item on the remote server, as a string.

mtime_nseconds[RW]

The nanosecond component of the modification time.

owner[W]

The owner of the item on the remote server, as a string.

type[RW]

The type of the item on the remote server. Must be one of the T_* constants.

### Public Class Methods

new(attributes={}) click to toggle source

Create a new Attributes instance with the given attributes. The following keys are supported:

- :type | the type of the item (integer, one of the T_ constants)

- :size | the size of the item (integer)

- :uid | the user-id that owns the file (integer)

- :gid | the group-id that owns the file (integer)

- :owner | the name of the user that owns the file (string)

- :group | the name of the group that owns the file (string)

- :permissions | the permissions on the file (integer, e.g. 0755)

- :atime | the access time of the file (integer, seconds since epoch)

- :atime_nseconds | the nanosecond component of atime (integer)

- :createtime | the time at which the file was created (integer, seconds since epoch)

- :createtime_nseconds | the nanosecond component of createtime (integer)

- :mtime | the modification time of the file (integer, seconds since epoch)

- :mtime_nseconds | the nanosecond component of mtime (integer)

- :acl | an array of ACL entries for the item

- :extended | a hash of name/value pairs identifying extended info

All of them default to `nil` if omitted, except for `type`, which defaults to T_REGULAR.

    # File lib/net/sftp/protocol/04/attributes.rb, line 124
    def initialize(attributes={})
      super
      attributes[:type] ||= T_REGULAR
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.