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.
| Use Case | Command | Description |
|---|---|---|
| Create new attributes | Net::SFTP::Protocol::V04::Attributes.new({...}) | Pass a hash with keys like :type, :size, :permissions, etc. |
| Access attribute values | attributes.type, attributes.size | Call method corresponding to attribute name (e.g., .type, .size, .mtime). |
| Set ACL entries | attributes.acl = [...] | Assign an array of ACL entries (structs). |
| Set owner/group by name | attributes.owner = "user", attributes.group = "group" | Use writer methods to set string owner/group. |
| Query file type | attributes.type | Returns an integer (one of the T_ constants). |
To specify new attributes, 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 infoLikewise, 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).
ACL β A simple struct for representing a single entry in an Access Control List. (See Net::SFTP::Constants::ACE)F_ACCESSTIME β [not documented]F_ACL β [not documented]F_CREATETIME β [not documented]F_MODIFYTIME β [not documented]F_OWNERGROUP β [not documented]F_SUBSECOND_TIMES β [not documented]new β Construct a new Attributes object (pass a hash as described above).acl β Returns the ACL array.atime_nseconds β Returns the nanosecond component of atime.createtime β Returns the creation time (seconds since epoch).createtime_nseconds β Returns the nanosecond component of createtime.group β Returns the group name (string).mtime_nseconds β Returns the nanosecond component of mtime.owner β Returns the owner name (string).type β Returns the file type (one of the T_ constants).attr_accessor acl β Read/write access to ACL.attr_accessor atime_nseconds β Read/write nanosecond atime.attr_accessor createtime β Read/write creation time.attr_accessor createtime_nseconds β Read/write nanosecond createtime.attr_accessor mtime_nseconds β Read/write nanosecond mtime.attr_accessor type β Read/write file type.attr_writer group β Writeβonly group name.attr_writer owner β Writeβonly owner name.Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-28 07:20 @216.73.217.46
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format