|
Trouble with hDuplicateTo before exec: msg#00075lang.haskell.glasgow.bugs
Hello. "hDuplicateTo src tgt" overwrites the tgt handle with the src handle, but it doesn't overwrite the file descriptor used by tgt with that used by src. Rather, it makes a copy of src's fd and makes the overwritten tgt use that. That's fine as long as we're in Haskell. But consider "hDuplicateTo h stdin". When calling executeFile afterwards, the replaced process expects its standard input on handle 0, not on the new fd generated by hDuplicateTo. A workaround would be to use dupTo instead of hDuplicateTo, if we intend to call executeFile afterwards, but I have the case that this isn't known at the time. I'm forking a supplied IO action, connecting it with a pipe. The IO action may or may not call executeFile. Regards, V.W.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | happy documentation fails to build, Ian Lynagh |
|---|---|
| Next by Date: | RE: happy documentation fails to build, Simon Marlow |
| Previous by Thread: | happy documentation fails to build, Ian Lynagh |
| Next by Thread: | [ ghc-Bugs-1062982 ] panic with GADTs, SourceForge.net |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |