hpath/HPath-IO-Errors.html

22 lines
30 KiB
HTML

<!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>HPath.IO.Errors</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_HPath-IO-Errors.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/HPath-IO-Errors.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">hpath-0.7.3: Support for well-typed paths</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>&#169; 2016 Julian Ospald</td></tr><tr><th>License</th><td>GPL-2</td></tr><tr><th>Maintainer</th><td>Julian Ospald &lt;hasufell@posteo.de&gt;</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Portability</th><td>portable</td></tr><tr><th>Safe Haskell</th><td>Safe</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">HPath.IO.Errors</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Types</a></li><li><a href="#g:2">Exception identifiers</a></li><li><a href="#g:3">Path based functions</a></li><li><a href="#g:4">Error handling functions</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Provides error handling.</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"><span class="keyword">data</span> <a href="#t:HPathIOException">HPathIOException</a><ul class="subs"><li>= <a href="#v:FileDoesNotExist">FileDoesNotExist</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></li><li>| <a href="#v:DirDoesNotExist">DirDoesNotExist</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></li><li>| <a href="#v:SameFile">SameFile</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></li><li>| <a href="#v:DestinationInSource">DestinationInSource</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></li><li>| <a href="#v:FileDoesExist">FileDoesExist</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></li><li>| <a href="#v:DirDoesExist">DirDoesExist</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></li><li>| <a href="#v:InvalidOperation">InvalidOperation</a> String</li><li>| <a href="#v:Can-39-tOpenDirectory">Can'tOpenDirectory</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></li><li>| <a href="#v:CopyFailed">CopyFailed</a> String</li></ul></li><li class="src short"><a href="#v:isFileDoesNotExist">isFileDoesNotExist</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool</li><li class="src short"><a href="#v:isDirDoesNotExist">isDirDoesNotExist</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool</li><li class="src short"><a href="#v:isSameFile">isSameFile</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool</li><li class="src short"><a href="#v:isDestinationInSource">isDestinationInSource</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool</li><li class="src short"><a href="#v:isFileDoesExist">isFileDoesExist</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool</li><li class="src short"><a href="#v:isDirDoesExist">isDirDoesExist</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool</li><li class="src short"><a href="#v:isInvalidOperation">isInvalidOperation</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool</li><li class="src short"><a href="#v:isCan-39-tOpenDirectory">isCan'tOpenDirectory</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool</li><li class="src short"><a href="#v:isCopyFailed">isCopyFailed</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool</li><li class="src short"><a href="#v:throwFileDoesExist">throwFileDoesExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO ()</li><li class="src short"><a href="#v:throwDirDoesExist">throwDirDoesExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO ()</li><li class="src short"><a href="#v:throwFileDoesNotExist">throwFileDoesNotExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO ()</li><li class="src short"><a href="#v:throwDirDoesNotExist">throwDirDoesNotExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO ()</li><li class="src short"><a href="#v:throwSameFile">throwSameFile</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO ()</li><li class="src short"><a href="#v:sameFile">sameFile</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO Bool</li><li class="src short"><a href="#v:throwDestinationInSource">throwDestinationInSource</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO ()</li><li class="src short"><a href="#v:doesFileExist">doesFileExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO Bool</li><li class="src short"><a href="#v:doesDirectoryExist">doesDirectoryExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO Bool</li><li class="src short"><a href="#v:isWritable">isWritable</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO Bool</li><li class="src short"><a href="#v:canOpenDirectory">canOpenDirectory</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO Bool</li><li class="src short"><a href="#v:throwCantOpenDirectory">throwCantOpenDirectory</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO ()</li><li class="src short"><a href="#v:catchErrno">catchErrno</a> :: [Errno] -&gt; IO a -&gt; IO a -&gt; IO a</li><li class="src short"><a href="#v:rethrowErrnoAs">rethrowErrnoAs</a> :: Exception e =&gt; [Errno] -&gt; e -&gt; IO a -&gt; IO a</li><li class="src short"><a href="#v:handleIOError">handleIOError</a> :: (IOError -&gt; IO a) -&gt; IO a -&gt; IO a</li><li class="src short"><a href="#v:bracketeer">bracketeer</a> :: IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c</li><li class="src short"><a href="#v:reactOnError">reactOnError</a> :: IO a -&gt; [(IOErrorType, IO a)] -&gt; [(<a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a>, IO a)] -&gt; IO a</li></ul></div><div id="interface"><h1 id="g:1">Types</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:HPathIOException" class="def">HPathIOException</a> <a href="src/HPath-IO-Errors.html#HPathIOException" class="link">Source</a> <a href="#t:HPathIOException" class="selflink">#</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:FileDoesNotExist" class="def">FileDoesNotExist</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:DirDoesNotExist" class="def">DirDoesNotExist</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:SameFile" class="def">SameFile</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:DestinationInSource" class="def">DestinationInSource</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:FileDoesExist" class="def">FileDoesExist</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:DirDoesExist" class="def">DirDoesExist</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:InvalidOperation" class="def">InvalidOperation</a> String</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:Can-39-tOpenDirectory" class="def">Can'tOpenDirectory</a> <a href="https://hackage.haskell.org/package/utf8-string-0.3.7/docs/Data-ByteString-UTF8.html#t:ByteString">ByteString</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:CopyFailed" class="def">CopyFailed</a> String</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:HPathIOException" class="caption collapser" onclick="toggleSection('i:HPathIOException')">Instances</p><div id="section.i:HPathIOException" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:HPathIOException:Eq:1" class="instance expander" onclick="toggleSection('i:id:HPathIOException:Eq:1')"></span> Eq <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></span> <a href="src/HPath-IO-Errors.html#line-117" class="link">Source</a> <a href="#t:HPathIOException" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:HPathIOException:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool</p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:HPathIOException:Data:2" class="instance expander" onclick="toggleSection('i:id:HPathIOException:Data:2')"></span> Data <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></span> <a href="src/HPath-IO-Errors.html#line-117" class="link">Source</a> <a href="#t:HPathIOException" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:HPathIOException:Data:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:gfoldl">gfoldl</a> :: (<span class="keyword">forall</span> d b. Data d =&gt; c (d -&gt; b) -&gt; d -&gt; c b) -&gt; (<span class="keyword">forall</span> g. g -&gt; c g) -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; c <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></p><p class="src"><a href="#v:gunfold">gunfold</a> :: (<span class="keyword">forall</span> b r. Data b =&gt; c (b -&gt; r) -&gt; c r) -&gt; (<span class="keyword">forall</span> r. r -&gt; c r) -&gt; Constr -&gt; c <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></p><p class="src"><a href="#v:toConstr">toConstr</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Constr</p><p class="src"><a href="#v:dataTypeOf">dataTypeOf</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; DataType</p><p class="src"><a href="#v:dataCast1">dataCast1</a> :: Typeable (* -&gt; *) t =&gt; (<span class="keyword">forall</span> d. Data d =&gt; c (t d)) -&gt; Maybe (c <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a>)</p><p class="src"><a href="#v:dataCast2">dataCast2</a> :: Typeable (* -&gt; * -&gt; *) t =&gt; (<span class="keyword">forall</span> d e. (Data d, Data e) =&gt; c (t d e)) -&gt; Maybe (c <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a>)</p><p class="src"><a href="#v:gmapT">gmapT</a> :: (<span class="keyword">forall</span> b. Data b =&gt; b -&gt; b) -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></p><p class="src"><a href="#v:gmapQl">gmapQl</a> :: (r -&gt; r' -&gt; r) -&gt; r -&gt; (<span class="keyword">forall</span> d. Data d =&gt; d -&gt; r') -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; r</p><p class="src"><a href="#v:gmapQr">gmapQr</a> :: (r' -&gt; r -&gt; r) -&gt; r -&gt; (<span class="keyword">forall</span> d. Data d =&gt; d -&gt; r') -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; r</p><p class="src"><a href="#v:gmapQ">gmapQ</a> :: (<span class="keyword">forall</span> d. Data d =&gt; d -&gt; u) -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; [u]</p><p class="src"><a href="#v:gmapQi">gmapQi</a> :: Int -&gt; (<span class="keyword">forall</span> d. Data d =&gt; d -&gt; u) -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; u</p><p class="src"><a href="#v:gmapM">gmapM</a> :: Monad m =&gt; (<span class="keyword">forall</span> d. Data d =&gt; d -&gt; m d) -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; m <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></p><p class="src"><a href="#v:gmapMp">gmapMp</a> :: MonadPlus m =&gt; (<span class="keyword">forall</span> d. Data d =&gt; d -&gt; m d) -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; m <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></p><p class="src"><a href="#v:gmapMo">gmapMo</a> :: MonadPlus m =&gt; (<span class="keyword">forall</span> d. Data d =&gt; d -&gt; m d) -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; m <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:HPathIOException:Show:3" class="instance expander" onclick="toggleSection('i:id:HPathIOException:Show:3')"></span> Show <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></span> <a href="src/HPath-IO-Errors.html#line-120" class="link">Source</a> <a href="#t:HPathIOException" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:HPathIOException:Show:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: Int -&gt; <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; ShowS</p><p class="src"><a href="#v:show">show</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; String</p><p class="src"><a href="#v:showList">showList</a> :: [<a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a>] -&gt; ShowS</p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:HPathIOException:Exception:4" class="instance expander" onclick="toggleSection('i:id:HPathIOException:Exception:4')"></span> Exception <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></span> <a href="src/HPath-IO-Errors.html#line-139" class="link">Source</a> <a href="#t:HPathIOException" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:HPathIOException:Exception:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toException">toException</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; SomeException</p><p class="src"><a href="#v:fromException">fromException</a> :: SomeException -&gt; Maybe <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></p><p class="src"><a href="#v:displayException">displayException</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; String</p></div></div></td></tr></table></div></div></div><h1 id="g:2">Exception identifiers</h1><div class="top"><p class="src"><a id="v:isFileDoesNotExist" class="def">isFileDoesNotExist</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool <a href="src/HPath-IO-Errors.html#isFileDoesNotExist" class="link">Source</a> <a href="#v:isFileDoesNotExist" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:isDirDoesNotExist" class="def">isDirDoesNotExist</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool <a href="src/HPath-IO-Errors.html#isDirDoesNotExist" class="link">Source</a> <a href="#v:isDirDoesNotExist" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:isSameFile" class="def">isSameFile</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool <a href="src/HPath-IO-Errors.html#isSameFile" class="link">Source</a> <a href="#v:isSameFile" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:isDestinationInSource" class="def">isDestinationInSource</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool <a href="src/HPath-IO-Errors.html#isDestinationInSource" class="link">Source</a> <a href="#v:isDestinationInSource" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:isFileDoesExist" class="def">isFileDoesExist</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool <a href="src/HPath-IO-Errors.html#isFileDoesExist" class="link">Source</a> <a href="#v:isFileDoesExist" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:isDirDoesExist" class="def">isDirDoesExist</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool <a href="src/HPath-IO-Errors.html#isDirDoesExist" class="link">Source</a> <a href="#v:isDirDoesExist" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:isInvalidOperation" class="def">isInvalidOperation</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool <a href="src/HPath-IO-Errors.html#isInvalidOperation" class="link">Source</a> <a href="#v:isInvalidOperation" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:isCan-39-tOpenDirectory" class="def">isCan'tOpenDirectory</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool <a href="src/HPath-IO-Errors.html#isCan%27tOpenDirectory" class="link">Source</a> <a href="#v:isCan-39-tOpenDirectory" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:isCopyFailed" class="def">isCopyFailed</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -&gt; Bool <a href="src/HPath-IO-Errors.html#isCopyFailed" class="link">Source</a> <a href="#v:isCopyFailed" class="selflink">#</a></p></div><h1 id="g:3">Path based functions</h1><div class="top"><p class="src"><a id="v:throwFileDoesExist" class="def">throwFileDoesExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO () <a href="src/HPath-IO-Errors.html#throwFileDoesExist" class="link">Source</a> <a href="#v:throwFileDoesExist" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:throwDirDoesExist" class="def">throwDirDoesExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO () <a href="src/HPath-IO-Errors.html#throwDirDoesExist" class="link">Source</a> <a href="#v:throwDirDoesExist" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:throwFileDoesNotExist" class="def">throwFileDoesNotExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO () <a href="src/HPath-IO-Errors.html#throwFileDoesNotExist" class="link">Source</a> <a href="#v:throwFileDoesNotExist" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:throwDirDoesNotExist" class="def">throwDirDoesNotExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO () <a href="src/HPath-IO-Errors.html#throwDirDoesNotExist" class="link">Source</a> <a href="#v:throwDirDoesNotExist" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:throwSameFile" class="def">throwSameFile</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO () <a href="src/HPath-IO-Errors.html#throwSameFile" class="link">Source</a> <a href="#v:throwSameFile" class="selflink">#</a></p><div class="doc"><p>Uses <code><a href="HPath-IO-Errors.html#v:isSameFile">isSameFile</a></code> and throws <code><a href="HPath-IO-Errors.html#v:SameFile">SameFile</a></code> if it returns True.</p></div></div><div class="top"><p class="src"><a id="v:sameFile" class="def">sameFile</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO Bool <a href="src/HPath-IO-Errors.html#sameFile" class="link">Source</a> <a href="#v:sameFile" class="selflink">#</a></p><div class="doc"><p>Check if the files are the same by examining device and file id.
This follows symbolic links.</p></div></div><div class="top"><p class="src"><a id="v:throwDestinationInSource" class="def">throwDestinationInSource</a> <a href="src/HPath-IO-Errors.html#throwDestinationInSource" class="link">Source</a> <a href="#v:throwDestinationInSource" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a></td><td class="doc"><p>source dir</p></td></tr><tr><td class="src">-&gt; <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a></td><td class="doc"><p>full destination, <code>dirname dest</code>
must exist</p></td></tr><tr><td class="src">-&gt; IO ()</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Checks whether the destination directory is contained
within the source directory by comparing the device+file ID of the
source directory with all device+file IDs of the parent directories
of the destination.</p></div></div><div class="top"><p class="src"><a id="v:doesFileExist" class="def">doesFileExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO Bool <a href="src/HPath-IO-Errors.html#doesFileExist" class="link">Source</a> <a href="#v:doesFileExist" class="selflink">#</a></p><div class="doc"><p>Checks if the given file exists and is not a directory.
Does not follow symlinks.</p></div></div><div class="top"><p class="src"><a id="v:doesDirectoryExist" class="def">doesDirectoryExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO Bool <a href="src/HPath-IO-Errors.html#doesDirectoryExist" class="link">Source</a> <a href="#v:doesDirectoryExist" class="selflink">#</a></p><div class="doc"><p>Checks if the given file exists and is a directory.
Does not follow symlinks.</p></div></div><div class="top"><p class="src"><a id="v:isWritable" class="def">isWritable</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO Bool <a href="src/HPath-IO-Errors.html#isWritable" class="link">Source</a> <a href="#v:isWritable" class="selflink">#</a></p><div class="doc"><p>Checks whether a file or folder is writable.</p></div></div><div class="top"><p class="src"><a id="v:canOpenDirectory" class="def">canOpenDirectory</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO Bool <a href="src/HPath-IO-Errors.html#canOpenDirectory" class="link">Source</a> <a href="#v:canOpenDirectory" class="selflink">#</a></p><div class="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><div class="top"><p class="src"><a id="v:throwCantOpenDirectory" class="def">throwCantOpenDirectory</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -&gt; IO () <a href="src/HPath-IO-Errors.html#throwCantOpenDirectory" class="link">Source</a> <a href="#v:throwCantOpenDirectory" class="selflink">#</a></p><div class="doc"><p>Throws a <code><a href="HPath-IO-Errors.html#v:Can-39-tOpenDirectory">Can'tOpenDirectory</a></code> HPathIOException if the directory at the given
path cannot be opened.</p></div></div><h1 id="g:4">Error handling functions</h1><div class="top"><p class="src"><a id="v:catchErrno" class="def">catchErrno</a> <a href="src/HPath-IO-Errors.html#catchErrno" class="link">Source</a> <a href="#v:catchErrno" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: [Errno]</td><td class="doc"><p>errno to catch</p></td></tr><tr><td class="src">-&gt; IO a</td><td class="doc"><p>action to try, which can raise an IOException</p></td></tr><tr><td class="src">-&gt; IO a</td><td class="doc"><p>action to carry out in case of an IOException and
if errno matches</p></td></tr><tr><td class="src">-&gt; IO a</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Carries out an action, then checks if there is an IOException and
a specific errno. If so, then it carries out another action, otherwise
it rethrows the error.</p></div></div><div class="top"><p class="src"><a id="v:rethrowErrnoAs" class="def">rethrowErrnoAs</a> <a href="src/HPath-IO-Errors.html#rethrowErrnoAs" class="link">Source</a> <a href="#v:rethrowErrnoAs" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: Exception e</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; [Errno]</td><td class="doc"><p>errno to catch</p></td></tr><tr><td class="src">-&gt; e</td><td class="doc"><p>rethrow as if errno matches</p></td></tr><tr><td class="src">-&gt; IO a</td><td class="doc"><p>action to try</p></td></tr><tr><td class="src">-&gt; IO a</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Execute the given action and retrow IO exceptions as a new Exception
that have the given errno. If errno does not match the exception is rethrown
as is.</p></div></div><div class="top"><p class="src"><a id="v:handleIOError" class="def">handleIOError</a> :: (IOError -&gt; IO a) -&gt; IO a -&gt; IO a <a href="src/HPath-IO-Errors.html#handleIOError" class="link">Source</a> <a href="#v:handleIOError" class="selflink">#</a></p><div class="doc"><p>Like <code>catchIOError</code>, with arguments swapped.</p></div></div><div class="top"><p class="src"><a id="v:bracketeer" class="def">bracketeer</a> <a href="src/HPath-IO-Errors.html#bracketeer" class="link">Source</a> <a href="#v:bracketeer" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: IO a</td><td class="doc"><p>computation to run first</p></td></tr><tr><td class="src">-&gt; (a -&gt; IO b)</td><td class="doc"><p>computation to run last, when
no exception was raised</p></td></tr><tr><td class="src">-&gt; (a -&gt; IO b)</td><td class="doc"><p>computation to run last,
when an exception was raised</p></td></tr><tr><td class="src">-&gt; (a -&gt; IO c)</td><td class="doc"><p>computation to run in-between</p></td></tr><tr><td class="src">-&gt; IO c</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Like <code>bracket</code>, but allows to have different clean-up
actions depending on whether the in-between computation
has raised an exception or not. </p></div></div><div class="top"><p class="src"><a id="v:reactOnError" class="def">reactOnError</a> <a href="src/HPath-IO-Errors.html#reactOnError" class="link">Source</a> <a href="#v:reactOnError" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: IO a</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; [(IOErrorType, IO a)]</td><td class="doc"><p>reaction on IO errors</p></td></tr><tr><td class="src">-&gt; [(<a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a>, IO a)]</td><td class="doc"><p>reaction on HPathIOException</p></td></tr><tr><td class="src">-&gt; IO a</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html>