83d5f27ee023f8b0ed7bf13c147e8824380596eb
[ghc-hetmet.git] / ghc / tests / lib / posix / posix010.hs
1 import Posix
2
3 main =
4     getUserEntryForName "sof"     >>= \ sof ->
5     getUserEntryForName "partain" >>= \ partain ->
6     putStr (ue2String sof) >>
7     putChar '\n' >>    
8     putStr (ue2String partain) >>
9     putChar '\n' >>    
10     getUserEntryForID (userID sof) >>= \ muid ->
11     getUserEntryForID (userID partain) >>= \ puid ->
12     putStr (ue2String muid) >>
13     putChar '\n' >>    
14     putStr (ue2String puid) >>
15     putChar '\n'
16
17 ue2String ue =
18     name ++ (':' : (show uid) ++ (':' : (show gid) ++ (':' : home ++ (':' : shell))))
19   where
20     name = userName ue
21     uid = userID ue
22     gid = userGroupID ue
23     home = homeDirectory ue
24     shell = userShell ue