Compiling hws with ghc 6
Simon Marlow
simonmar@microsoft.com
Tue, 10 Jun 2003 12:10:26 +0100
=20
> I'm trying to compile the haskell web server (from the=20
> haskell-libs project=20
> at sf.net) with ghc6 and I'm stuck on the last function in Util.hs:
>=20
> statMaybe filename =3D do
> maybe_stat <- tryJust ioErrors (getFileStatus filename)
> case maybe_stat of
> Left e -> do
> errno <- getErrorCode
> if errno =3D=3D eNOENT
> then return Nothing
> else ioError e
> Right stat ->
> return (Just stat)
>=20
>=20
> What are the equivalents for getFileStatus and getErrorCode=20
> these days?
>
> I suppose Foreign.C.Error.getErrno might substitute for=20
> getErrorCode, but I'm stumped on getFileStatus.
You're right about getErrno. getFileStatus is available from
System.Posix.
Cheers,
Simon