<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>HPath.IO.Errors</title><linkhref="ocean.css"rel="stylesheet"type="text/css"title="Ocean"/><scriptsrc="haddock-util.js"type="text/javascript"></script><scripttype="text/javascript">//<![CDATA[
do not provide.</p></div><divclass="subs constructors"><pclass="caption">Constructors</p><table><tr><tdclass="src"><aname="v:SameFile"class="def">SameFile</a><ahref="https://hackage.haskell.org/package/bytestring-0.10.4.0/docs/Data-ByteString.html#t:ByteString">ByteString</a><ahref="https://hackage.haskell.org/package/bytestring-0.10.4.0/docs/Data-ByteString.html#t:ByteString">ByteString</a></td><tdclass="doc empty"> </td></tr><tr><tdclass="src"><aname="v:DestinationInSource"class="def">DestinationInSource</a><ahref="https://hackage.haskell.org/package/bytestring-0.10.4.0/docs/Data-ByteString.html#t:ByteString">ByteString</a><ahref="https://hackage.haskell.org/package/bytestring-0.10.4.0/docs/Data-ByteString.html#t:ByteString">ByteString</a></td><tdclass="doc empty"> </td></tr><tr><tdclass="src"><aname="v:RecursiveFailure"class="def">RecursiveFailure</a> [(<ahref="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a>, <ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Control-Exception-Base.html#t:IOException">IOException</a>)]</td><tdclass="doc empty"> </td></tr></table></div><divclass="subs instances"><pid="control.i:HPathIOException"class="caption collapser"onclick="toggleSection('i:HPathIOException')">Instances</p><divid="section.i:HPathIOException"class="show"><table><tr><tdclass="src"><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Eq.html#t:Eq">Eq</a><ahref="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></td><tdclass="doc empty"> </td></tr><tr><tdclass="src"><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Text-Show.html#t:Show">Show</a><ahref="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></td><tdclass="doc empty"> </td></tr><tr><tdclass="src"><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Control-Exception-Base.html#t:Exception">Exception</a><ahref="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></td><tdclass="doc empty"> </td></tr><tr><tdclass="src"><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Typeable-Internal.html#t:Typeable">Typeable</a> * <ahref="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></td><tdclass="doc empty"> </td></tr></table></div></div></div><divclass="top"><pclass="src"><spanclass="keyword">data</span><aname="t:RecursiveFailureHint"class="def">RecursiveFailureHint</a><ahref="src/HPath-IO-Errors.html#RecursiveFailureHint"class="link">Source</a></p><divclass="doc"><p>A type for giving failure hints on recursive failure, which allows
This follows symbolic links.</p></div></div><divclass="top"><pclass="src"><aname="v:throwDestinationInSource"class="def">throwDestinationInSource</a><ahref="src/HPath-IO-Errors.html#throwDestinationInSource"class="link">Source</a></p><divclass="subs arguments"><pclass="caption">Arguments</p><table><tr><tdclass="src">:: <ahref="HPath.html#t:Path">Path</a><ahref="HPath.html#t:Abs">Abs</a></td><tdclass="doc"><p>source dir</p></td></tr><tr><tdclass="src">-><ahref="HPath.html#t:Path">Path</a><ahref="HPath.html#t:Abs">Abs</a></td><tdclass="doc"><p>full destination, <code>dirname dest</code>
must exist</p></td></tr><tr><tdclass="src">-><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> ()</td><tdclass="doc empty"> </td></tr></table></div><divclass="doc"><p>Checks whether the destination directory is contained
of the destination.</p></div></div><divclass="top"><pclass="src"><aname="v:doesFileExist"class="def">doesFileExist</a> :: <ahref="HPath.html#t:Path">Path</a><ahref="HPath.html#t:Abs">Abs</a> -><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a><ahref="src/HPath-IO-Errors.html#doesFileExist"class="link">Source</a></p><divclass="doc"><p>Checks if the given file exists and is not a directory.
Does not follow symlinks.</p></div></div><divclass="top"><pclass="src"><aname="v:doesDirectoryExist"class="def">doesDirectoryExist</a> :: <ahref="HPath.html#t:Path">Path</a><ahref="HPath.html#t:Abs">Abs</a> -><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a><ahref="src/HPath-IO-Errors.html#doesDirectoryExist"class="link">Source</a></p><divclass="doc"><p>Checks if the given file exists and is a directory.
Does not follow symlinks.</p></div></div><divclass="top"><pclass="src"><aname="v:isWritable"class="def">isWritable</a> :: <ahref="HPath.html#t:Path">Path</a><ahref="HPath.html#t:Abs">Abs</a> -><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a><ahref="src/HPath-IO-Errors.html#isWritable"class="link">Source</a></p><divclass="doc"><p>Checks whether a file or folder is writable.</p></div></div><divclass="top"><pclass="src"><aname="v:canOpenDirectory"class="def">canOpenDirectory</a> :: <ahref="HPath.html#t:Path">Path</a><ahref="HPath.html#t:Abs">Abs</a> -><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a><ahref="src/HPath-IO-Errors.html#canOpenDirectory"class="link">Source</a></p><divclass="doc"><p>Checks whether the directory at the given path exists and can be
opened. This invokes <code>openDirStream</code> which follows symlinks.</p></div></div><h1id="g:4">Error handling functions</h1><divclass="top"><pclass="src"><aname="v:catchErrno"class="def">catchErrno</a><ahref="src/HPath-IO-Errors.html#catchErrno"class="link">Source</a></p><divclass="subs arguments"><pclass="caption">Arguments</p><table><tr><tdclass="src">:: [<ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Foreign-C-Error.html#t:Errno">Errno</a>]</td><tdclass="doc"><p>errno to catch</p></td></tr><tr><tdclass="src">-><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><tdclass="doc"><p>action to try, which can raise an IOException</p></td></tr><tr><tdclass="src">-><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><tdclass="doc"><p>action to carry out in case of an IOException and
if errno matches</p></td></tr><tr><tdclass="src">-><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><tdclass="doc empty"> </td></tr></table></div><divclass="doc"><p>Carries out an action, then checks if there is an IOException and
it rethrows the error.</p></div></div><divclass="top"><pclass="src"><aname="v:rethrowErrnoAs"class="def">rethrowErrnoAs</a><ahref="src/HPath-IO-Errors.html#rethrowErrnoAs"class="link">Source</a></p><divclass="subs arguments"><pclass="caption">Arguments</p><table><tr><tdclass="src">:: <ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Control-Exception-Base.html#t:Exception">Exception</a> e</td><tdclass="doc empty"> </td></tr><tr><tdclass="src">=> [<ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Foreign-C-Error.html#t:Errno">Errno</a>]</td><tdclass="doc"><p>errno to catch</p></td></tr><tr><tdclass="src">-> e</td><tdclass="doc"><p>rethrow as if errno matches</p></td></tr><tr><tdclass="src">-><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><tdclass="doc"><p>action to try</p></td></tr><tr><tdclass="src">-><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><tdclass="doc empty"> </td></tr></table></div><divclass="doc"><p>Execute the given action and retrow IO exceptions as a new Exception
as is.</p></div></div><divclass="top"><pclass="src"><aname="v:handleIOError"class="def">handleIOError</a> :: (<ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO-Error.html#t:IOError">IOError</a> -><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a) -><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a -><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a <ahref="src/HPath-IO-Errors.html#handleIOError"class="link">Source</a></p><divclass="doc"><p>Like <code><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO-Error.html#v:catchIOError">catchIOError</a></code>, with arguments swapped.</p></div></div><divclass="top"><pclass="src"><aname="v:bracketeer"class="def">bracketeer</a><ahref="src/HPath-IO-Errors.html#bracketeer"class="link">Source</a></p><divclass="subs arguments"><pclass="caption">Arguments</p><table><tr><tdclass="src">:: <ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><tdclass="doc"><p>computation to run first</p></td></tr><tr><tdclass="src">-> (a -><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> b)</td><tdclass="doc"><p>computation to run last, when
no exception was raised</p></td></tr><tr><tdclass="src">-> (a -><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> b)</td><tdclass="doc"><p>computation to run last,
when an exception was raised</p></td></tr><tr><tdclass="src">-> (a -><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> c)</td><tdclass="doc"><p>computation to run in-between</p></td></tr><tr><tdclass="src">-><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> c</td><tdclass="doc empty"> </td></tr></table></div><divclass="doc"><p>Like <code><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/Control-Exception-Base.html#v:bracket">bracket</a></code>, but allows to have different clean-up
has raised an exception or not. </p></div></div><divclass="top"><pclass="src"><aname="v:reactOnError"class="def">reactOnError</a><ahref="src/HPath-IO-Errors.html#reactOnError"class="link">Source</a></p><divclass="subs arguments"><pclass="caption">Arguments</p><table><tr><tdclass="src">:: <ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><tdclass="doc empty"> </td></tr><tr><tdclass="src">-> [(<ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO-Error.html#t:IOErrorType">IOErrorType</a>, <ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a)]</td><tdclass="doc"><p>reaction on IO errors</p></td></tr><tr><tdclass="src">-> [(<ahref="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a>, <ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a)]</td><tdclass="doc"><p>reaction on HPathIOException</p></td></tr><tr><tdclass="src">-><ahref="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><tdclass="doc empty"> </td></tr></table></div></div></div></div><divid="footer"><p>Produced by <ahref="http://www.haskell.org/haddock/">Haddock</a> version 2.14.3</p></div></body></html>