lib/net/sftp/protocol/01/attributes.rb
# Inspects the permissions bits to determine what type of entity this
# attributes object represents. If will return one of the T_ constants.
Inspects the permissions bits to determine what type of entity this
attributes object represents. If will return one of the T_ constants.
Inspects the permissions bits to determine what type of entity this attributes object represents . If will return one of the T_ constants .
def type
      if    permissions & 0140000 == 0140000 then 
        T_SOCKET
      elsif permissions & 0120000 == 0120000 then 
        T_SYMLINK
      elsif permissions & 0100000 == 0100000 then
        T_REGULAR
      elsif permissions &  060000 ==  060000 then
        T_BLOCK_DEVICE
      elsif permissions &  040000 ==  040000 then
        T_DIRECTORY
      elsif permissions &  020000 ==  020000 then
        T_CHAR_DEVICE
      elsif permissions &  010000 ==  010000 then
        T_FIFO
      else
        T_UNKNOWN
      end
    end
def type if permissions & 0140000 == 0140000 then T_SOCKET elsif permissions & 0120000 == 0120000 then T_SYMLINK elsif permissions & 0100000 == 0100000 then T_REGULAR elsif permissions & 060000 == 060000 then T_BLOCK_DEVICE elsif permissions & 040000 == 040000 then T_DIRECTORY elsif permissions & 020000 == 020000 then T_CHAR_DEVICE elsif permissions & 010000 == 010000 then T_FIFO else T_UNKNOWN end end
Inspects the permissions bits to determine what type of entity this
attributes object represents.
Inspects the permissions bits to determine what type of entity this attributes object represents .