posix :: Passwd :: defaultinit
core :: Pointer :: address_is_null
Is the address behind this Object at NULL?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
posix :: Passwd :: defaultinit
core :: Pointer :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).
# Information on a user account
extern class Passwd `{struct passwd*`}
# Get the `Passwd` of the user with the `uid`
new from_uid(uid: Int) `{ return getpwuid(uid); `}
# Get the `Passwd` of the user with the `name`
new from_name(name: String) import String.to_cstring `{ return getpwnam( String_to_cstring(name) ); `}
# Username
fun name: String import CString.to_s `{ return CString_to_s(self->pw_name); `}
# User password
fun passwd: String import CString.to_s `{ return CString_to_s(self->pw_passwd); `}
# User ID
fun uid: Int `{ return self->pw_uid; `}
# Group ID
fun gid: Int `{ return self->pw_gid; `}
# Home directory
fun dir: String import CString.to_s `{ return CString_to_s(self->pw_dir); `}
# Shell program
fun shell: String import CString.to_s `{ return CString_to_s(self->pw_shell); `}
end
lib/posix/posix.nit:51,1--76,3