hDuplicateTo still buggy

Volker Wysk post at volker-wysk.de
Tue Apr 12 03:13:33 EDT 2005


Hello.

You can't replace a closed handle with hDuplicateTo:

import IO
import GHC.Handle

main = do
   hClose stdout
   h <- openFile "/tmp/out" WriteMode
   hDuplicateTo h stdout

This produces:

bug1: /tmp/out: hDuplicateTo: invalid argument (Bad file descriptor)


Bye,
V.W.



More information about the Glasgow-haskell-bugs mailing list