Moduleghc-internal-10.0.0Haskell2010
GHC.Internal.IO.Handle.Internals
This module defines the basic operations on I/O "handles". All of the operations defined here are independent of the underlying device.
The API of this module is unstable and not meant to be consumed by the general public.
If you absolutely must depend on it, make sure to use a tight upper
bound, e.g., base < 4.X rather than base < 5, because the interface can
change rapidly without much warning.
Synopsis
- value withHandle
- value withHandle'
- value withHandle_
- value withHandle__'
- value withHandle_'
- value withAllHandles__
- value wantWritableHandle
- value wantReadableHandle
- value wantReadableHandle_
- value wantSeekableHandle
- value mkHandle
- value mkFileHandle
- value mkFileHandleNoFinalizer
- value mkDuplexHandle
- value mkDuplexHandleNoFinalizer
- value addHandleFinalizer
- value openTextEncoding
- value closeTextCodecs
- value initBufferState
- value dEFAULT_CHAR_BUFFER_SIZE
- value flushBuffer
- value flushWriteBuffer
- value flushCharReadBuffer
- value flushCharBuffer
- value flushByteReadBuffer
- value flushByteWriteBuffer
- value readTextDevice
- value writeCharBuffer
- value readTextDeviceNonBlocking
- value decodeByteBuf
- value augmentIOError
- value ioe_closedHandle
- value ioe_semiclosedHandle
- value ioe_EOF
- value ioe_notReadable
- value ioe_notWritable
- value ioe_finalizedHandle
- value ioe_bufsiz
- value hClose_impl
- value hClose_help
- value hLookAhead_
- type HandleFinalizer
- value handleFinalizer
- value debugIO
- value traceIO
- Packageghc-internal-10.0.0
- Exports45
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceInternals.hs
mkFileHandle :: (RawIO dev, IODevice dev, BufferedIO dev, Typeable dev)=> devthe underlying IO device, which must support IODevice, BufferedIO and Typeable
-> FilePatha string describing the Handle, e.g. the file path for a file. Used in error messages.
-> IOMode-> Maybe TextEncoding-> NewlineMode-> IO Handle
makes a new Handle
mkFileHandleNoFinalizer :: (RawIO dev, IODevice dev, BufferedIO dev, Typeable dev)=> devthe underlying IO device, which must support IODevice, BufferedIO and Typeable
-> FilePatha string describing the Handle, e.g. the file path for a file. Used in error messages.
-> IOMode-> Maybe TextEncoding-> NewlineMode-> IO Handle
makes a new Handle without a finalizer.
like mkFileHandle, except that a Handle is created with two independent buffers, one for reading and one for writing. Used for full-duplex streams, such as network sockets.
like mkFileHandle, except that a Handle is created with two independent buffers, one for reading and one for writing. Used for full-duplex streams, such as network sockets.
syncs the file with the buffer, including moving the file pointer backwards in the case of a read buffer. This can fail on a non-seekable read Handle.
flushes the Char buffer only. Works on all Handles.
This function exists temporarily to avoid an unused import warning in
bytestring.