getCurrentUser

Return the SystemUser entry for the current effective user.

version(Posix)
@trusted
getCurrentUser
()

Return Value

SystemUser for the calling process's effective UID.

Throws

Exception if the entry cannot be found or an error occurs.

Examples

import unit_threaded.assertions;
import core.sys.posix.unistd: geteuid;

auto user = getCurrentUser();
user.uid.shouldEqual(geteuid());

Meta