Method: LinuxStat::User.uids

Defined in:
lib/linux_stat/user.rb

.uidsObject

Returns all the user IDs as Hash.

For example:

LinuxStat::User.uids
=> {:root=>0, :bin=>1, :daemon=>2, :mail=>8, :ftp=>14}

But if the status isn’t available it will return an empty Hash.



42
43
44
45
46
47
# File 'lib/linux_stat/user.rb', line 42

def uids
  return {} unless passwd_readable?
  passwd_splitted.reduce({}) { |h, x|
    h.merge!(x[0].to_sym => x[2].to_i)
  }
end