Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 2313

ghc-7.4.2-4.mga5.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>GHC.IO.Handle.FD</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_GHC-IO-Handle-FD.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">base-4.5.1.0: Basic libraries</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>non-portable</td></tr><tr><th>Stability</th><td>internal</td></tr><tr><th>Maintainer</th><td>libraries@haskell.org</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr></table><p class="caption">GHC.IO.Handle.FD</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Handle operations implemented by file descriptors (FDs)
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:stdin">stdin</a> :: <a href="GHC-IO-Handle.html#t:Handle">Handle</a></li><li class="src short"><a href="#v:stdout">stdout</a> :: <a href="GHC-IO-Handle.html#t:Handle">Handle</a></li><li class="src short"><a href="#v:stderr">stderr</a> :: <a href="GHC-IO-Handle.html#t:Handle">Handle</a></li><li class="src short"><a href="#v:openFile">openFile</a> :: <a href="System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="System-IO.html#t:IOMode">IOMode</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></li><li class="src short"><a href="#v:openBinaryFile">openBinaryFile</a> :: <a href="System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="System-IO.html#t:IOMode">IOMode</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></li><li class="src short"><a href="#v:openFileBlocking">openFileBlocking</a> :: <a href="System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="System-IO.html#t:IOMode">IOMode</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></li><li class="src short"><a href="#v:mkHandleFromFD">mkHandleFromFD</a> :: FD -&gt; <a href="GHC-IO-Device.html#t:IODeviceType">IODeviceType</a> -&gt; <a href="System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="System-IO.html#t:IOMode">IOMode</a> -&gt; <a href="Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Data-Maybe.html#t:Maybe">Maybe</a> <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></li><li class="src short"><a href="#v:fdToHandle">fdToHandle</a> :: FD -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></li><li class="src short"><a href="#v:fdToHandle-39-">fdToHandle'</a> :: <a href="Foreign-C-Types.html#t:CInt">CInt</a> -&gt; <a href="Data-Maybe.html#t:Maybe">Maybe</a> <a href="GHC-IO-Device.html#t:IODeviceType">IODeviceType</a> -&gt; <a href="Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="System-IO.html#t:IOMode">IOMode</a> -&gt; <a href="Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></li><li class="src short"><a href="#v:isEOF">isEOF</a> :: <a href="System-IO.html#t:IO">IO</a> <a href="Data-Bool.html#t:Bool">Bool</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:stdin" class="def">stdin</a> :: <a href="GHC-IO-Handle.html#t:Handle">Handle</a></p><div class="doc"><p>A handle managing input from the Haskell program's standard input channel.
</p></div></div><div class="top"><p class="src"><a name="v:stdout" class="def">stdout</a> :: <a href="GHC-IO-Handle.html#t:Handle">Handle</a></p><div class="doc"><p>A handle managing output to the Haskell program's standard output channel.
</p></div></div><div class="top"><p class="src"><a name="v:stderr" class="def">stderr</a> :: <a href="GHC-IO-Handle.html#t:Handle">Handle</a></p><div class="doc"><p>A handle managing output to the Haskell program's standard error channel.
</p></div></div><div class="top"><p class="src"><a name="v:openFile" class="def">openFile</a> :: <a href="System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="System-IO.html#t:IOMode">IOMode</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></p><div class="doc"><p>Computation <code><a href="GHC-IO-Handle-FD.html#v:openFile">openFile</a></code> <code>file mode</code> allocates and returns a new, open
 handle to manage the file <code>file</code>.  It manages input if <code>mode</code>
 is <code><a href="System-IO.html#v:ReadMode">ReadMode</a></code>, output if <code>mode</code> is <code><a href="System-IO.html#v:WriteMode">WriteMode</a></code> or <code><a href="System-IO.html#v:AppendMode">AppendMode</a></code>,
 and both input and output if mode is <code><a href="System-IO.html#v:ReadWriteMode">ReadWriteMode</a></code>.
</p><p>If the file does not exist and it is opened for output, it should be
 created as a new file.  If <code>mode</code> is <code><a href="System-IO.html#v:WriteMode">WriteMode</a></code> and the file
 already exists, then it should be truncated to zero length.
 Some operating systems delete empty files, so there is no guarantee
 that the file will exist following an <code><a href="GHC-IO-Handle-FD.html#v:openFile">openFile</a></code> with <code>mode</code>
 <code><a href="System-IO.html#v:WriteMode">WriteMode</a></code> unless it is subsequently written to successfully.
 The handle is positioned at the end of the file if <code>mode</code> is
 <code><a href="System-IO.html#v:AppendMode">AppendMode</a></code>, and otherwise at the beginning (in which case its
 internal position is 0).
 The initial buffer mode is implementation-dependent.
</p><p>This operation may fail with:
</p><ul><li> <code>isAlreadyInUseError</code> if the file is already open and cannot be reopened;
</li><li> <code>isDoesNotExistError</code> if the file does not exist; or
</li><li> <code>isPermissionError</code> if the user does not have permission to open the file.
</li></ul><p>Note: if you will be working with files containing binary data, you'll want to
 be using <code><a href="GHC-IO-Handle-FD.html#v:openBinaryFile">openBinaryFile</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:openBinaryFile" class="def">openBinaryFile</a> :: <a href="System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="System-IO.html#t:IOMode">IOMode</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></p><div class="doc"><p>Like <code><a href="GHC-IO-Handle-FD.html#v:openFile">openFile</a></code>, but open the file in binary mode.
 On Windows, reading a file in text mode (which is the default)
 will translate CRLF to LF, and writing will translate LF to CRLF.
 This is usually what you want with text files.  With binary files
 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 <code><a href="GHC-IO-Handle.html#v:hSetBinaryMode">hSetBinaryMode</a></code>.)
</p></div></div><div class="top"><p class="src"><a name="v:openFileBlocking" class="def">openFileBlocking</a> :: <a href="System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="System-IO.html#t:IOMode">IOMode</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></p><div class="doc"><p>Like <code><a href="GHC-IO-Handle-FD.html#v:openFile">openFile</a></code>, but opens the file in ordinary blocking mode.
 This can be useful for opening a FIFO for reading: if we open in
 non-blocking mode then the open will fail if there are no writers,
 whereas a blocking open will block until a writer appears.
</p></div></div><div class="top"><p class="src"><a name="v:mkHandleFromFD" class="def">mkHandleFromFD</a> :: FD -&gt; <a href="GHC-IO-Device.html#t:IODeviceType">IODeviceType</a> -&gt; <a href="System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="System-IO.html#t:IOMode">IOMode</a> -&gt; <a href="Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Data-Maybe.html#t:Maybe">Maybe</a> <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></p></div><div class="top"><p class="src"><a name="v:fdToHandle" class="def">fdToHandle</a> :: FD -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></p><div class="doc"><p>Turn an existing file descriptor into a Handle.  This is used by
 various external libraries to make Handles.
</p><p>Makes a binary Handle.  This is for historical reasons; it should
 probably be a text Handle with the default encoding and newline
 translation instead.
</p></div></div><div class="top"><p class="src"><a name="v:fdToHandle-39-" class="def">fdToHandle'</a> :: <a href="Foreign-C-Types.html#t:CInt">CInt</a> -&gt; <a href="Data-Maybe.html#t:Maybe">Maybe</a> <a href="GHC-IO-Device.html#t:IODeviceType">IODeviceType</a> -&gt; <a href="Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="System-IO.html#t:IOMode">IOMode</a> -&gt; <a href="Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="GHC-IO-Handle.html#t:Handle">Handle</a></p><div class="doc"><p>Old API kept to avoid breaking clients
</p></div></div><div class="top"><p class="src"><a name="v:isEOF" class="def">isEOF</a> :: <a href="System-IO.html#t:IO">IO</a> <a href="Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>The computation <code><a href="GHC-IO-Handle-FD.html#v:isEOF">isEOF</a></code> is identical to <code><a href="GHC-IO-Handle.html#v:hIsEOF">hIsEOF</a></code>,
 except that it works only on <code><a href="GHC-IO-Handle-FD.html#v:stdin">stdin</a></code>.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>