hpath/unix/tests/libposix/posix010.hs

17 lines
483 B
Haskell
Raw Normal View History

2020-04-14 09:27:28 +00:00
import System.Posix
main = do
root <- getUserEntryForName "root"
putStrLn (ue2String root)
root' <- getUserEntryForID (userID root)
putStrLn (ue2String root')
if homeDirectory root == homeDirectory root' &&
userShell root == userShell root'
then putStrLn "OK"
else putStrLn "Mismatch"
ue2String ue = concat [name, ":", show uid, ":", show gid]
where name = userName ue
uid = userID ue
gid = userGroupID ue