|
openFile "/dev/null" WriteMode fails: msg#00103lang.haskell.glasgow.bugs
Hello. The following program produces an "invalid operation" IOError: import IO main = do h <- openFile "/dev/null" WriteMode hPutStrLn h "bla" `catch` (\ioe -> putStrLn (show ioe)) When called: /dev/null: openFile: invalid argument (Invalid argument) It works with AppendMode. I'm not sure if that's to be considered a bug. It's counter-intuitive, and openFile shouldn't fail with "invalid operation", since the API docs (and the Language Report) say: This operation may fail with: * isAlreadyInUseError if the file is already open and cannot be reopened; * isDoesNotExistError if the file does not exist; or * isPermissionError if the user does not have permission to open the file. I'm using GHC 6.4 on Debian Linux. Bye, V.W.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ ghc-Bugs-1188155 ] Bootstrapping fails at System/CPUTime_hsc.c, SourceForge.net |
|---|---|
| Next by Date: | [ ghc-Bugs-1182027 ] building on an AMD64, SourceForge.net |
| Previous by Thread: | [ ghc-Bugs-1188155 ] Bootstrapping fails at System/CPUTime_hsc.c, SourceForge.net |
| Next by Thread: | RE: openFile "/dev/null" WriteMode fails, Simon Marlow |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |