hpath/System-Posix-Directory-Traversals.html
travis-ci a61fcb2567 Lastest docs updated
travis build: 67
commit: 4f047dbc77
auto-pushed to gh-pages
2016-06-05 12:53:37 +00:00

11 lines
14 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>System.Posix.Directory.Traversals</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_System-Posix-Directory-Traversals.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/System-Posix-Directory-Traversals.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.5: 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>BSD3</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>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">System.Posix.Directory.Traversals</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Traversal and read operations on directories.</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:getDirectoryContents">getDirectoryContents</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [(<a href="System-Posix-Directory-Foreign.html#t:DirType">DirType</a>, <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>)]</li><li class="src short"><a href="#v:getDirectoryContents-39-">getDirectoryContents'</a> :: <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [(<a href="System-Posix-Directory-Foreign.html#t:DirType">DirType</a>, <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>)]</li><li class="src short"><a href="#v:allDirectoryContents">allDirectoryContents</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [<a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>]</li><li class="src short"><a href="#v:allDirectoryContents-39-">allDirectoryContents'</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [<a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>]</li><li class="src short"><a href="#v:traverseDirectory">traverseDirectory</a> :: (s -&gt; <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> s) -&gt; s -&gt; <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> s</li><li class="src short"><a href="#v:readDirEnt">readDirEnt</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (<a href="System-Posix-Directory-Foreign.html#t:DirType">DirType</a>, <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>)</li><li class="src short"><a href="#v:packDirStream">packDirStream</a> :: <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Foreign-Ptr.html#t:Ptr">Ptr</a> CDir -&gt; <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a></li><li class="src short"><a href="#v:unpackDirStream">unpackDirStream</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Foreign-Ptr.html#t:Ptr">Ptr</a> CDir</li><li class="src short"><a href="#v:fdOpendir">fdOpendir</a> :: <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a></li><li class="src short"><a href="#v:realpath">realpath</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a id="v:getDirectoryContents" class="def">getDirectoryContents</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [(<a href="System-Posix-Directory-Foreign.html#t:DirType">DirType</a>, <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>)] <a href="src/System-Posix-Directory-Traversals.html#getDirectoryContents" class="link">Source</a> <a href="#v:getDirectoryContents" class="selflink">#</a></p><div class="doc"><p>Gets all directory contents (not recursively).</p></div></div><div class="top"><p class="src"><a id="v:getDirectoryContents-39-" class="def">getDirectoryContents'</a> :: <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [(<a href="System-Posix-Directory-Foreign.html#t:DirType">DirType</a>, <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>)] <a href="src/System-Posix-Directory-Traversals.html#getDirectoryContents%27" class="link">Source</a> <a href="#v:getDirectoryContents-39-" class="selflink">#</a></p><div class="doc"><p>Like <code><a href="System-Posix-Directory-Traversals.html#v:getDirectoryContents">getDirectoryContents</a></code> except for a file descriptor.</p><p>To avoid complicated error checks, the file descriptor is
<strong>always</strong> closed, even if <code><a href="System-Posix-Directory-Traversals.html#v:fdOpendir">fdOpendir</a></code> fails. Usually, this
only happens on successful <code><a href="System-Posix-Directory-Traversals.html#v:fdOpendir">fdOpendir</a></code> and after the directory
stream is closed. Also see the manpage of <code>fdopendir(3)</code> for
more details.</p></div></div><div class="top"><p class="src"><a id="v:allDirectoryContents" class="def">allDirectoryContents</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [<a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>] <a href="src/System-Posix-Directory-Traversals.html#allDirectoryContents" class="link">Source</a> <a href="#v:allDirectoryContents" class="selflink">#</a></p><div class="doc"><p>Get all files from a directory and its subdirectories.</p><p>Upon entering a directory, <code><a href="System-Posix-Directory-Traversals.html#v:allDirectoryContents">allDirectoryContents</a></code> will get all entries
strictly. However the returned list is lazy in that directories will only
be accessed on demand.</p><p>Follows symbolic links for the input dir.</p></div></div><div class="top"><p class="src"><a id="v:allDirectoryContents-39-" class="def">allDirectoryContents'</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [<a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>] <a href="src/System-Posix-Directory-Traversals.html#allDirectoryContents%27" class="link">Source</a> <a href="#v:allDirectoryContents-39-" class="selflink">#</a></p><div class="doc"><p>Get all files from a directory and its subdirectories strictly.</p><p>Follows symbolic links for the input dir.</p></div></div><div class="top"><p class="src"><a id="v:traverseDirectory" class="def">traverseDirectory</a> :: (s -&gt; <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> s) -&gt; s -&gt; <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> s <a href="src/System-Posix-Directory-Traversals.html#traverseDirectory" class="link">Source</a> <a href="#v:traverseDirectory" class="selflink">#</a></p><div class="doc"><p>Recursively apply the <code>action</code> to the parent directory and all
files/subdirectories.</p><p>This function allows for memory-efficient traversals.</p><p>Follows symbolic links for the input dir.</p></div></div><div class="top"><p class="src"><a id="v:readDirEnt" class="def">readDirEnt</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (<a href="System-Posix-Directory-Foreign.html#t:DirType">DirType</a>, <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>) <a href="src/System-Posix-Directory-Traversals.html#readDirEnt" class="link">Source</a> <a href="#v:readDirEnt" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:packDirStream" class="def">packDirStream</a> :: <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Foreign-Ptr.html#t:Ptr">Ptr</a> CDir -&gt; <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a> <a href="src/System-Posix-Directory-Traversals.html#packDirStream" class="link">Source</a> <a href="#v:packDirStream" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:unpackDirStream" class="def">unpackDirStream</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Foreign-Ptr.html#t:Ptr">Ptr</a> CDir <a href="src/System-Posix-Directory-Traversals.html#unpackDirStream" class="link">Source</a> <a href="#v:unpackDirStream" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:fdOpendir" class="def">fdOpendir</a> :: <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a> <a href="src/System-Posix-Directory-Traversals.html#fdOpendir" class="link">Source</a> <a href="#v:fdOpendir" class="selflink">#</a></p><div class="doc"><p>Binding to <code>fdopendir(3)</code>.</p></div></div><div class="top"><p class="src"><a id="v:realpath" class="def">realpath</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> <a href="https://hackage.haskell.org/package/unix-2.7.2.0/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> <a href="src/System-Posix-Directory-Traversals.html#realpath" class="link">Source</a> <a href="#v:realpath" class="selflink">#</a></p><div class="doc"><p>return the canonicalized absolute pathname</p><p>like canonicalizePath, but uses <code>realpath(3)</code></p></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>