Commit 64a50445 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

base: Mention openFile throwing does-not-exist-errors on FIFOs

As discussed in #15715, the POSIX specification specifies that
attempting to open a FIFO in write-only mode when the FIFO has no
readers will fail with -ENOENT.

[skip ci]

Test Plan: Read it

Reviewers: hvr

Subscribers: rwbarton, carter

GHC Trac Issues: #15715

Differential Revision: https://phabricator.haskell.org/D5295

(cherry picked from commit 4ba3fa31)
parent c2c6f498
......@@ -130,7 +130,9 @@ addFilePathToIOError fun fp ioe
--
-- * 'isAlreadyInUseError' if the file is already open and cannot be reopened;
--
-- * 'isDoesNotExistError' if the file does not exist; or
-- * 'isDoesNotExistError' if the file does not exist or
-- (on POSIX systems) is a FIFO without a reader and 'WriteMode' was
-- requested; or
--
-- * 'isPermissionError' if the user does not have permission to open the file.
--
......@@ -161,7 +163,7 @@ openFileBlocking fp im =
-- this is undesirable; also, as usual under Microsoft operating systems,
-- text mode treats control-Z as EOF. Binary mode turns off all special
-- treatment of end-of-line and end-of-file characters.
-- (See also 'hSetBinaryMode'.)
-- (See also 'System.IO.hSetBinaryMode'.)
openBinaryFile :: FilePath -> IOMode -> IO Handle
openBinaryFile fp m =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment