ecc941648f
travis build: 87
commit: 1a2c77c6a6
auto-pushed to gh-pages
25 lines
30 KiB
HTML
25 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 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.8.0: Support for well-typed paths</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>© 2016 Julian Ospald</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>Julian Ospald <hasufell@posteo.de></td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Portability</th><td>portable</td></tr><tr><th>Safe Haskell</th><td>None</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:SameFile">SameFile</a> <a href="https://hackage.haskell.org/package/bytestring-0.10.4.0/docs/Data-ByteString.html#t:ByteString">ByteString</a> <a href="https://hackage.haskell.org/package/bytestring-0.10.4.0/docs/Data-ByteString.html#t:ByteString">ByteString</a></li><li>| <a href="#v:DestinationInSource">DestinationInSource</a> <a href="https://hackage.haskell.org/package/bytestring-0.10.4.0/docs/Data-ByteString.html#t:ByteString">ByteString</a> <a href="https://hackage.haskell.org/package/bytestring-0.10.4.0/docs/Data-ByteString.html#t:ByteString">ByteString</a></li><li>| <a href="#v:RecursiveFailure">RecursiveFailure</a> [(<a href="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a>, <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Control-Exception-Base.html#t:IOException">IOException</a>)]</li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:RecursiveFailureHint">RecursiveFailureHint</a><ul class="subs"><li>= <a href="#v:ReadContentsFailed">ReadContentsFailed</a> (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>) (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>)</li><li>| <a href="#v:CreateDirFailed">CreateDirFailed</a> (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>) (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>)</li><li>| <a href="#v:CopyFileFailed">CopyFileFailed</a> (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>) (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>)</li><li>| <a href="#v:RecreateSymlinkFailed">RecreateSymlinkFailed</a> (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>) (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>)</li></ul></li><li class="src short"><a href="#v:isSameFile">isSameFile</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isDestinationInSource">isDestinationInSource</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isRecursiveFailure">isRecursiveFailure</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isReadContentsFailed">isReadContentsFailed</a> :: <a href="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isCreateDirFailed">isCreateDirFailed</a> :: <a href="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isCopyFileFailed">isCopyFileFailed</a> :: <a href="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isRecreateSymlinkFailed">isRecreateSymlinkFailed</a> :: <a href="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a></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> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> ()</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> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> ()</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> -> <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> ()</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> -> <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a></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> -> <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> ()</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> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a></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> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a></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> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a></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> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:catchErrno">catchErrno</a> :: [<a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Foreign-C-Error.html#t:Errno">Errno</a>] -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:rethrowErrnoAs">rethrowErrnoAs</a> :: <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Control-Exception-Base.html#t:Exception">Exception</a> e => [<a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Foreign-C-Error.html#t:Errno">Errno</a>] -> e -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:handleIOError">handleIOError</a> :: (<a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO-Error.html#t:IOError">IOError</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a) -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:bracketeer">bracketeer</a> :: <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a -> (a -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> b) -> (a -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> b) -> (a -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> c) -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> c</li><li class="src short"><a href="#v:reactOnError">reactOnError</a> :: <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a -> [(<a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO-Error.html#t:IOErrorType">IOErrorType</a>, <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a)] -> [(<a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a>, <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a)] -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> 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 name="t:HPathIOException" class="def">HPathIOException</a> <a href="src/HPath-IO-Errors.html#HPathIOException" class="link">Source</a></p><div class="doc"><p>Additional generic IO exceptions that the posix functions
|
|
do not provide.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:SameFile" class="def">SameFile</a> <a href="https://hackage.haskell.org/package/bytestring-0.10.4.0/docs/Data-ByteString.html#t:ByteString">ByteString</a> <a href="https://hackage.haskell.org/package/bytestring-0.10.4.0/docs/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:DestinationInSource" class="def">DestinationInSource</a> <a href="https://hackage.haskell.org/package/bytestring-0.10.4.0/docs/Data-ByteString.html#t:ByteString">ByteString</a> <a href="https://hackage.haskell.org/package/bytestring-0.10.4.0/docs/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:RecursiveFailure" class="def">RecursiveFailure</a> [(<a href="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a>, <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Control-Exception-Base.html#t:IOException">IOException</a>)]</td><td class="doc empty"> </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"><a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Eq.html#t:Eq">Eq</a> <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Text-Show.html#t:Show">Show</a> <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Control-Exception-Base.html#t:Exception">Exception</a> <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Typeable-Internal.html#t:Typeable">Typeable</a> * <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:RecursiveFailureHint" class="def">RecursiveFailureHint</a> <a href="src/HPath-IO-Errors.html#RecursiveFailureHint" class="link">Source</a></p><div class="doc"><p>A type for giving failure hints on recursive failure, which allows
|
|
to programmatically make choices without examining
|
|
the weakly typed I/O error attributes (like <code>ioeGetFileName</code>).</p><p>The first argument to the data constructor is always the
|
|
source and the second the destination.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ReadContentsFailed" class="def">ReadContentsFailed</a> (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>) (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>)</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:CreateDirFailed" class="def">CreateDirFailed</a> (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>) (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>)</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:CopyFileFailed" class="def">CopyFileFailed</a> (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>) (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>)</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:RecreateSymlinkFailed" class="def">RecreateSymlinkFailed</a> (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>) (<a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a>)</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:RecursiveFailureHint" class="caption collapser" onclick="toggleSection('i:RecursiveFailureHint')">Instances</p><div id="section.i:RecursiveFailureHint" class="show"><table><tr><td class="src"><a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Eq.html#t:Eq">Eq</a> <a href="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Text-Show.html#t:Show">Show</a> <a href="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a></td><td class="doc empty"> </td></tr></table></div></div></div><h1 id="g:2">Exception identifiers</h1><div class="top"><p class="src"><a name="v:isSameFile" class="def">isSameFile</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HPath-IO-Errors.html#isSameFile" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:isDestinationInSource" class="def">isDestinationInSource</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HPath-IO-Errors.html#isDestinationInSource" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:isRecursiveFailure" class="def">isRecursiveFailure</a> :: <a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HPath-IO-Errors.html#isRecursiveFailure" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:isReadContentsFailed" class="def">isReadContentsFailed</a> :: <a href="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HPath-IO-Errors.html#isReadContentsFailed" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:isCreateDirFailed" class="def">isCreateDirFailed</a> :: <a href="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HPath-IO-Errors.html#isCreateDirFailed" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:isCopyFileFailed" class="def">isCopyFileFailed</a> :: <a href="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HPath-IO-Errors.html#isCopyFileFailed" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:isRecreateSymlinkFailed" class="def">isRecreateSymlinkFailed</a> :: <a href="HPath-IO-Errors.html#t:RecursiveFailureHint">RecursiveFailureHint</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HPath-IO-Errors.html#isRecreateSymlinkFailed" class="link">Source</a></p></div><h1 id="g:3">Path based functions</h1><div class="top"><p class="src"><a name="v:throwFileDoesExist" class="def">throwFileDoesExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> () <a href="src/HPath-IO-Errors.html#throwFileDoesExist" class="link">Source</a></p><div class="doc"><p>Throws <code>AlreadyExists</code> <code><a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO-Error.html#t:IOError">IOError</a></code> if file exists.</p></div></div><div class="top"><p class="src"><a name="v:throwDirDoesExist" class="def">throwDirDoesExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> () <a href="src/HPath-IO-Errors.html#throwDirDoesExist" class="link">Source</a></p><div class="doc"><p>Throws <code>AlreadyExists</code> <code><a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO-Error.html#t:IOError">IOError</a></code> if directory exists.</p></div></div><div class="top"><p class="src"><a name="v:throwSameFile" class="def">throwSameFile</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> () <a href="src/HPath-IO-Errors.html#throwSameFile" class="link">Source</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 name="v:sameFile" class="def">sameFile</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HPath-IO-Errors.html#sameFile" class="link">Source</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 name="v:throwDestinationInSource" class="def">throwDestinationInSource</a> <a href="src/HPath-IO-Errors.html#throwDestinationInSource" class="link">Source</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">-> <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">-> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> ()</td><td class="doc empty"> </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 name="v:doesFileExist" class="def">doesFileExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HPath-IO-Errors.html#doesFileExist" class="link">Source</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 name="v:doesDirectoryExist" class="def">doesDirectoryExist</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HPath-IO-Errors.html#doesDirectoryExist" class="link">Source</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 name="v:isWritable" class="def">isWritable</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HPath-IO-Errors.html#isWritable" class="link">Source</a></p><div class="doc"><p>Checks whether a file or folder is writable.</p></div></div><div class="top"><p class="src"><a name="v:canOpenDirectory" class="def">canOpenDirectory</a> :: <a href="HPath.html#t:Path">Path</a> <a href="HPath.html#t:Abs">Abs</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HPath-IO-Errors.html#canOpenDirectory" class="link">Source</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><h1 id="g:4">Error handling functions</h1><div class="top"><p class="src"><a name="v:catchErrno" class="def">catchErrno</a> <a href="src/HPath-IO-Errors.html#catchErrno" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: [<a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Foreign-C-Error.html#t:Errno">Errno</a>]</td><td class="doc"><p>errno to catch</p></td></tr><tr><td class="src">-> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><td class="doc"><p>action to try, which can raise an IOException</p></td></tr><tr><td class="src">-> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> 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">-> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><td class="doc empty"> </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 name="v:rethrowErrnoAs" class="def">rethrowErrnoAs</a> <a href="src/HPath-IO-Errors.html#rethrowErrnoAs" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Control-Exception-Base.html#t:Exception">Exception</a> e</td><td class="doc empty"> </td></tr><tr><td class="src">=> [<a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Foreign-C-Error.html#t:Errno">Errno</a>]</td><td class="doc"><p>errno to catch</p></td></tr><tr><td class="src">-> e</td><td class="doc"><p>rethrow as if errno matches</p></td></tr><tr><td class="src">-> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><td class="doc"><p>action to try</p></td></tr><tr><td class="src">-> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><td class="doc empty"> </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 name="v:handleIOError" class="def">handleIOError</a> :: (<a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO-Error.html#t:IOError">IOError</a> -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a) -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a <a href="src/HPath-IO-Errors.html#handleIOError" class="link">Source</a></p><div class="doc"><p>Like <code><a href="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><div class="top"><p class="src"><a name="v:bracketeer" class="def">bracketeer</a> <a href="src/HPath-IO-Errors.html#bracketeer" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><td class="doc"><p>computation to run first</p></td></tr><tr><td class="src">-> (a -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> b)</td><td class="doc"><p>computation to run last, when
|
|
no exception was raised</p></td></tr><tr><td class="src">-> (a -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> b)</td><td class="doc"><p>computation to run last,
|
|
when an exception was raised</p></td></tr><tr><td class="src">-> (a -> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> c)</td><td class="doc"><p>computation to run in-between</p></td></tr><tr><td class="src">-> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> c</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Like <code><a href="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
|
|
actions depending on whether the in-between computation
|
|
has raised an exception or not. </p></div></div><div class="top"><p class="src"><a name="v:reactOnError" class="def">reactOnError</a> <a href="src/HPath-IO-Errors.html#reactOnError" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><td class="doc empty"> </td></tr><tr><td class="src">-> [(<a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO-Error.html#t:IOErrorType">IOErrorType</a>, <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a)]</td><td class="doc"><p>reaction on IO errors</p></td></tr><tr><td class="src">-> [(<a href="HPath-IO-Errors.html#t:HPathIOException">HPathIOException</a>, <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a)]</td><td class="doc"><p>reaction on HPathIOException</p></td></tr><tr><td class="src">-> <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> a</td><td class="doc empty"> </td></tr></table></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.14.3</p></div></body></html> |