License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
IO Routine
Synopsis
- putStrLn :: String -> IO ()
- putStr :: String -> IO ()
- stdin :: Handle
- stdout :: Handle
-
data
IOMode
- = ReadMode
- | WriteMode
- | AppendMode
- | ReadWriteMode
- openFile :: FilePath -> IOMode -> IO Handle
- closeFile :: Handle -> IO ()
- withFile :: FilePath -> IOMode -> ( Handle -> IO r) -> IO r
- hGet :: Handle -> Int -> IO ( UArray Word8 )
- hPut :: Handle -> UArray Word8 -> IO ()
- readFile :: FilePath -> IO ( UArray Word8 )
Terminal
A handle managing output to the Haskell program's standard output channel.
File
See
openFile
Instances
Enum IOMode |
Since: base-4.2.0.0 |
Defined in GHC.IO.IOMode succ :: IOMode -> IOMode Source # pred :: IOMode -> IOMode Source # toEnum :: Int -> IOMode Source # fromEnum :: IOMode -> Int Source # enumFrom :: IOMode -> [ IOMode ] Source # enumFromThen :: IOMode -> IOMode -> [ IOMode ] Source # enumFromTo :: IOMode -> IOMode -> [ IOMode ] Source # enumFromThenTo :: IOMode -> IOMode -> IOMode -> [ IOMode ] Source # |
|
Eq IOMode |
Since: base-4.2.0.0 |
Ord IOMode |
Since: base-4.2.0.0 |
Read IOMode |
Since: base-4.2.0.0 |
Show IOMode |
Since: base-4.2.0.0 |
Ix IOMode |
Since: base-4.2.0.0 |
openFile :: FilePath -> IOMode -> IO Handle Source #
list the file name in the given FilePath directory
TODO: error management and not implemented yet getDirectory :: FilePath -> IO [FileName] getDirectory = undefined
Open a new handle on the file
withFile :: FilePath -> IOMode -> ( Handle -> IO r) -> IO r Source #
opens a file using the mode
withFile
filepath mode act
and run act
. the by-product handle will be closed when act finish,
either normally or through an exception.
The value returned is the result of act@