Fix and enable posix010
[ghc.git] / testsuite / tests / lib / libposix / posix011.hs
1 import Posix
2
3 main =
4 getGroupEntryForName "grasp" >>= \ grasp ->
5 getGroupEntryForName "staff" >>= \ staff ->
6 putStr (ge2String grasp) >>
7 putChar '\n' >>
8 putStr (ge2String staff) >>
9 putChar '\n' >>
10 getGroupEntryForID (groupID grasp) >>= \ guid ->
11 getGroupEntryForID (groupID staff) >>= \ suid ->
12 putStr (ge2String guid) >>
13 putChar '\n' >>
14 putStr (ge2String suid) >>
15 putChar '\n'
16
17 ge2String ge =
18 name ++ (':' : (show gid) ++ (':' : members))
19 where
20 name = groupName ge
21 gid = groupID ge
22 members = foldr (\x y -> x ++ (',' : y)) "" (groupMembers ge)