require 'net/ssh/buffer' module Net; module SFTP; module Protocol; module V01 # 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: # # * :size:: the size of the file # * :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) # * :mtime:: the modification time of the file (integer, seconds since epoch) # * :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). class Attributes 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 class <