Class | Net::SFTP::Protocol::V01::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.
To specify new attributes, just pass a hash as the argument to the constructor. The following keys are supported:
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).
F_SIZE | = | 0x00000001 |
F_UIDGID | = | 0x00000002 |
F_PERMISSIONS | = | 0x00000004 |
F_ACMODTIME | = | 0x00000008 |
F_EXTENDED | = | 0x80000000 |
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 |
atime | [RW] | The last access time of the file |
attributes | [R] | The hash of name/value pairs that backs this Attributes instance |
extended | [RW] | The hash of name/value pairs identifying extended information about the file |
gid | [W] | The group-id of the user that owns the file |
mtime | [RW] | The modification time of the file |
permissions | [RW] | The permissions on the file |
size | [RW] | The size of the file. |
uid | [W] | The user-id of the user that owns the file |
Parses the given buffer and returns an Attributes object compsed from the data extracted from it.
Create a new Attributes instance with the given attributes. The following keys are supported:
Returns the type as a symbol, rather than an integer, for easier use in Ruby programs.
Convert the object to a string suitable for passing in an SFTP packet. This is the raw representation of the attribute packet payload, and is not intended to be human readable.
Inspects the permissions bits to determine what type of entity this attributes object represents. If will return one of the T_ constants.