hpath/System-Posix-Directory-Traversals.html

11 lines
13 KiB
HTML
Raw Normal View History

<!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 type="text/javascript">//<![CDATA[
2016-06-01 12:52:48 +00:00
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.8.0: 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.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.7.0.2/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.0.1/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.7.0.2/docs/System-Posix-Types.html#t:Fd">Fd</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.7.0.2/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.0.1/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.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <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/unix-2.7.0.1/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.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <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/unix-2.7.0.1/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.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> s) -&gt; s -&gt; <a href="https://hackage.haskell.org/package/unix-2.7.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.7.0.2/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.0.1/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.7.0.2/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.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a
2016-06-01 12:52:48 +00:00
<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 name="v:allDirectoryContents" class="def">allDirectoryContents</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <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/unix-2.7.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>] <a href="src/System-Posix-Directory-Traversals.html#allDirectoryContents" class="link">Source</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
2016-06-01 12:52:48 +00:00
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 name="v:allDirectoryContents-39-" class="def">allDirectoryContents'</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <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/unix-2.7.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>] <a href="src/System-Posix-Directory-Traversals.html#allDirectoryContents%27" class="link">Source</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 name="v:traverseDirectory" class="def">traverseDirectory</a> :: (s -&gt; <a href="https://hackage.haskell.org/package/unix-2.7.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> s) -&gt; s -&gt; <a href="https://hackage.haskell.org/package/unix-2.7.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-IO.html#t:IO">IO</a> s <a href="src/System-Posix-Directory-Traversals.html#traverseDirectory" class="link">Source</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 name="v:readDirEnt" class="def">readDirEnt</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.0.1/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.7.0.2/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.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a>) <a href="src/System-Posix-Directory-Traversals.html#readDirEnt" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:packDirStream" class="def">packDirStream</a> :: <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Foreign-Ptr.html#t:Ptr">Ptr</a> CDir -&gt; <a href="https://hackage.haskell.org/package/unix-2.7.0.1/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a> <a href="src/System-Posix-Directory-Traversals.html#packDirStream" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:unpackDirStream" class="def">unpackDirStream</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.0.1/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/Foreign-Ptr.html#t:Ptr">Ptr</a> CDir <a href="src/System-Posix-Directory-Traversals.html#unpackDirStream" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:fdOpendir" class="def">fdOpendir</a> :: <a href="https://hackage.haskell.org/package/base-4.7.0.2/docs/System-Posix-Types.html#t:Fd">Fd</a> -&gt; <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/unix-2.7.0.1/docs/System-Posix-Directory-ByteString.html#t:DirStream">DirStream</a> <a href="src/System-Posix-Directory-Traversals.html#fdOpendir" class="link">Source</a></p><div class="doc"><p>Binding to <code>fdopendir(3)</code>.</p></div></div><div class="top"><p class="src"><a name="v:realpath" class="def">realpath</a> :: <a href="https://hackage.haskell.org/package/unix-2.7.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> -&gt; <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/unix-2.7.0.1/docs/System-Posix-ByteString-FilePath.html#t:RawFilePath">RawFilePath</a> <a href="src/System-Posix-Directory-Traversals.html#realpath" class="link">Source</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.14.3</p></div></body></html>