with-user-cache ( quot -- ) (original) (raw)

with-user-cache ( quot -- )

Vocabulary
unix.users

Inputs

quot a quotation

Outputs
None

Word description
Iterates over the password file using library calls and creates a cache in the user-cache symbol. The cache is a hashtable indexed by user id. When looking up many users, this approach is much faster than calling system calls.

Definition

USING: kernel namespaces ;

IN: unix.users

: with-user-cache ( quot -- )
[ user-cache ] dip with-variable ; inline