| Copyright | (c) The University of Glasgow 2017 |
|---|---|
| License | see libraries/base/LICENSE |
| Maintainer | libraries@haskell.org |
| Stability | internal |
| Portability | non-portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GHC.IO.Windows.Handle
Description
Raw read/write operations on Windows Handles
Synopsis
- data NativeHandle
- data ConsoleHandle
- data IoHandle a
- type HANDLE = Ptr ()
- type Io a = IoHandle a
- convertHandle :: Io ConsoleHandle -> Bool -> Io NativeHandle
- toHANDLE :: RawHandle a => a -> HANDLE
- fromHANDLE :: RawHandle a => HANDLE -> a
- handleToMode :: HANDLE -> IO IOMode
- isAsynchronous :: IoHandle NativeHandle -> Bool
- optimizeFileAccess :: HANDLE -> IO ()
- stdin :: Io ConsoleHandle
- stdout :: Io ConsoleHandle
- stderr :: Io ConsoleHandle
- openFile :: FilePath -> IOMode -> Bool -> IO (Io NativeHandle, IODeviceType)
- openFileAsTemp :: FilePath -> Bool -> Bool -> IO (Io NativeHandle, IODeviceType)
- release :: RawHandle a => a -> IO ()
Basic Types
data NativeHandle Source #
Instances
data ConsoleHandle Source #
Instances
Bit of a Hack, but we don't want every handle to have a cooked entry but all copies of the handles for which we do want one need to share the same value. We can't store it separately because we don't know when the handle will be destroyed or invalidated.
Instances
Utility functions
convertHandle :: Io ConsoleHandle -> Bool -> Io NativeHandle Source #
Convert a ConsoleHandle into a general FileHandle This will change which DeviceIO is used.
fromHANDLE :: RawHandle a => HANDLE -> a Source #
optimizeFileAccess :: HANDLE -> IO () Source #
Standard Handles
stdin :: Io ConsoleHandle Source #
stdout :: Io ConsoleHandle Source #
stderr :: Io ConsoleHandle Source #
File utilities
Arguments
| :: FilePath | file to open |
| -> IOMode | mode in which to open the file |
| -> Bool | open the file in non-blocking mode? |
| -> IO (Io NativeHandle, IODeviceType) |
Open a file and make an NativeHandle for it. Truncates the file to zero
size when the IOMode is WriteMode.
Arguments
| :: FilePath | file to open |
| -> Bool | open the file in non-blocking mode? |
| -> Bool | Exclusive mode |
| -> IO (Io NativeHandle, IODeviceType) |
Open a file as a temporary file and make an NativeHandle for it.
Truncates the file to zero size when the IOMode is WriteMode.