base-4.14.0.0: Basic libraries
Copyright(c) The University of Glasgow 1994-2008
Licensesee libraries/base/LICENSE
Maintainerlibraries@haskell.org
Stabilityinternal
Portabilitynon-portable
Safe HaskellTrustworthy
LanguageHaskell2010

GHC.IO.FD

Description

Raw read/write operations on file descriptors

Synopsis

Documentation

data FD #

Constructors

FD 

Fields

Instances

Instances details
Show FD #

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.FD

Methods

showsPrec :: Int -> FD -> ShowS #

show :: FD -> String #

showList :: [FD] -> ShowS #

IODevice FD #

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.FD

Methods

ready :: FD -> Bool -> Int -> IO Bool #

close :: FD -> IO () #

isTerminal :: FD -> IO Bool #

isSeekable :: FD -> IO Bool #

seek :: FD -> SeekMode -> Integer -> IO () #

tell :: FD -> IO Integer #

getSize :: FD -> IO Integer #

setSize :: FD -> Integer -> IO () #

setEcho :: FD -> Bool -> IO () #

getEcho :: FD -> IO Bool #

setRaw :: FD -> Bool -> IO () #

devType :: FD -> IO IODeviceType #

dup :: FD -> IO FD #

dup2 :: FD -> FD -> IO FD #

RawIO FD #

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.FD

Methods

read :: FD -> Ptr Word8 -> Int -> IO Int #

readNonBlocking :: FD -> Ptr Word8 -> Int -> IO (Maybe Int) #

write :: FD -> Ptr Word8 -> Int -> IO () #

writeNonBlocking :: FD -> Ptr Word8 -> Int -> IO Int #

BufferedIO FD #

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.FD

openFile #

Arguments

:: FilePath

file to open

-> IOMode

mode in which to open the file

-> Bool

open the file in non-blocking mode?

-> IO (FD, IODeviceType) 

Open a file and make an FD for it. Truncates the file to zero size when the IOMode is WriteMode.

mkFD #

Arguments

:: CInt 
-> IOMode 
-> Maybe (IODeviceType, CDev, CIno) 
-> Bool

is a socket (on Windows)

-> Bool

is in non-blocking mode on Unix

-> IO (FD, IODeviceType) 

Make a FD from an existing file descriptor. Fails if the FD refers to a directory. If the FD refers to a file, mkFD locks the file according to the Haskell 2010 single writer/multiple reader locking semantics (this is why we need the IOMode argument too).

release :: FD -> IO () #