lib/net/sftp/protocol/01/attributes.rb
# Returns the username of the user that owns the file, or +nil+ if that
# information is not available. If the :uid is given, but not the :owner,
# the Etc module will be used to lookup the name from the id. This might
# fail on some systems (e.g. Windows).
Returns the username of the user that owns the file, or +nil+ if that
information is not available. If the :uid is given, but not the :owner,
the Etc module will be used to lookup the name from the id. This might
fail on some systems .
Returns the username of the user that owns the file or + nil + if that information is not available . If the : uid is given but not the : owner the Etc module will be used to lookup the name from the id . This might fail on some systems .
def owner
      if attributes[:uid] && !attributes[:owner]
        require 'etc'
        attributes[:owner] = Etc.getpwuid(attributes[:uid].to_i).name
      end
      attributes[:owner]
    end
def owner if attributes [ :uid ] && ! attributes [ :owner ] require 'etc' attributes [ :owner ] = Etc . getpwuid ( attributes [ :uid ] . to_i ) . name end attributes [ :owner ] end
Returns the username of the user that owns the file, or +nil+ if that
information is not available.
Returns the username of the user that owns the file or + nil + if that information is not available .