struct System::Group

Defined in:

system/group.cr

Constant Summary

GID_MAX = 4294967295_u32
NGROUPS_MAX = LibC::NGROUPS_MAX

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.get(gid : Int) : Group #

Returns the group specified by the group ID. Raises System::Group::NotFoundError if not found.


[View source]
def self.get(groupname : String) : Group #

Returns the group specified by the groupname. Raises System::Group::NotFoundError if not found.


[View source]
def self.get?(gid : Int) : Group? #

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


[View source]
def self.get?(groupname : String) : Group? #

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


[View source]

Class Method Detail

def self.gid(groupname : String) : UInt32 #

Returns the group ID for the given group name. Raises System::Group::NotFoundError if group does not exist.


[View source]
def self.gid?(groupname : String) : UInt32? #

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


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

Returns the group name for the given group ID. Raises System::Group::NotFoundError if group does not exist.


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

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


[View source]

Instance Method Detail

def ==(other : self) #

def each_member(&block : User -> Nil) : Nil #

Yields members as Users.


[View source]
def each_member_name(&block : String -> Nil) : Nil #

Yields member names as Strings.


[View source]
def gid : UInt32 #

Returns the group ID.


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

See Object#hash(hasher)


def member_names : Array(String) #

Returns an Array of the member names as Strings.


[View source]
def members : Array(User) #

Returns an Array of the members as Users.


[View source]
def name : String #

Returns the group name as a String.


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

Appends the group name to the given IO.


[View source]
def to_s : String #

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


[View source]