struct System::User

Defined in:

system/user.cr

Constant Summary

UID_MAX = 4294967295_u32

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.get(uid : Int) : User #

Returns the user specified by the user ID. Raises System::User::NotFoundError if not found.


[View source]
def self.get(username : String) : User #

Returns the user specified by the user name. Raises System::User::NotFoundError if not found.


[View source]
def self.get?(uid : Int) : User? #

Returns the user specified by the user ID. Returns nil if not found.


[View source]
def self.get?(username : String) : User? #

Returns the user specified by the user name. Returns nil if not found.


[View source]

Class Method Detail

def self.name(uid : Int) : String #

Returns the user name for the given user ID. Raises System::User::NotFoundError if no user exists.


[View source]
def self.name?(uid : Int) : String? #

Returns the user name for the given user ID. Returns nil if no user exists.


[View source]
def self.uid(username : String) : UInt32 #

Returns the user ID for the given user name. Raises System::User::NotFoundError if no user exists.


[View source]
def self.uid?(username : String) : UInt32? #

Returns the user ID for the given user name. Returns nil if no user exists.


[View source]

Instance Method Detail

def ==(other : self) #

def gid : UInt32 #

Returns the user group ID.


[View source]
def group #

Returns the primary Group for the user.


[View source]
def hash(hasher) #
Description copied from struct Struct

See Object#hash(hasher)


def home : String #

Returns the path for the user's home as a String.


[View source]
def info : String #

Returns additional information about the user as a String.


[View source]
def name : String #

Returns the user name as a String.


[View source]
def shell : String #

Returns the path for the user's shell as a String.


[View source]
def to_s(io : IO) #

Appends the user name to the given IO.


[View source]
def to_s : String #

Returns a String representation of the user, it's user name.


[View source]
def uid : UInt32 #

Returns the user ID.


[View source]