mkstemp in Haskell
Martin Sjögren
md9ms@mdstud.chalmers.se
27 May 2003 11:05:32 +0200
--=-rccBXY2gl3JAJTZcG3Xr
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
tis 2003-05-27 klockan 10.42 skrev Martin Norb=E4ck:
> tis 2003-05-27 klockan 09.20 skrev Volker Stolz:
> > In local.libraries, you wrote:
> > > I needed a function for creating temporary files. Since I couldn't fi=
nd
> > > one in the standard library, I just hacked one up using the ffi. It's=
in
> > > the haskell-libs cvs [1]. I've got an icky import of GHC.Handle to ge=
t
> > > openFd, any way I could get rid of it? (fdToHandle isn't enough)
> >=20
> > It's in the Posix Spec, so we might as well put it in System.Posix.
>=20
> Yes, and perhaps you want to return (String, Handle) so that you know
> the file name (in case you want to do something else than just
> reading/writing from it).
Well, I peek at the CString and use that as the file name when creating
the Handle. I assumed that there was a way to get this from the Handle
(other than the Show instance that is). Maybe there isn't?
/Martin
--=20
Martin Sj=F6gren
sjogren@debian.org -- marvin@dum.chalmers.se
GPG key: http://www.mdstud.chalmers.se/~md9ms/gpg.html
let hello =3D "hello" : hello in putStr (unlines hello)
--=-rccBXY2gl3JAJTZcG3Xr
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Detta =?ISO-8859-1?Q?=E4r?= en digitalt signerad
meddelandedel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQA+0ypcGpBPiZwE9FYRAi47AJ4zHpgUdFeZmTS7Lt5A+fOHCHlexwCgsGy3
ippEBWpF2e8DIyi2vJ9f3Ew=
=FLFR
-----END PGP SIGNATURE-----
--=-rccBXY2gl3JAJTZcG3Xr--