Fix combinators so that directory. can infer on Unix

db4
Slava Pestov 2008-11-18 11:45:55 -06:00
parent 67c8fd8182
commit f44d8f4cf5
2 changed files with 8 additions and 4 deletions

View File

@ -76,9 +76,11 @@ M: integer user-groups ( id -- seq )
: all-groups ( -- seq )
[ getgrent dup ] [ group-struct>group ] [ drop ] produce ;
: <group-cache> ( -- assoc )
all-groups [ [ id>> ] keep ] H{ } map>assoc ;
: with-group-cache ( quot -- )
all-groups [ [ id>> ] keep ] H{ } map>assoc
group-cache rot with-variable ; inline
[ <group-cache> group-cache ] dip with-variable ; inline
: real-group-id ( -- id )
getgid ; inline

View File

@ -41,9 +41,11 @@ PRIVATE>
SYMBOL: user-cache
: <user-cache> ( -- assoc )
all-users [ [ uid>> ] keep ] H{ } map>assoc ;
: with-user-cache ( quot -- )
all-users [ [ uid>> ] keep ] H{ } map>assoc
user-cache rot with-variable ; inline
[ <user-cache> user-cache ] dip with-variable ; inline
GENERIC: user-passwd ( obj -- passwd )