hsfm/HSFM-FileSystem-FileType.html

36 lines
69 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>HSFM.FileSystem.FileType</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[
2016-06-01 17:32:51 +00:00
window.onload = function () {pageLoad();setSynopsis("mini_HSFM-FileSystem-FileType.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/HSFM-FileSystem-FileType.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">hsfm-gtk</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">HSFM.FileSystem.FileType</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module provides a data type for representing directories/files
in a well-typed and convenient way. This is useful to gather and
save information about a file, so the information can be easily
processed in e.g. a GUI.</p><p>However, it's not meant to be used to interact with low-level
functions that copy files etc, since there's no guarantee that
the in-memory representation of the type still matches what is
happening on filesystem level.</p><p>If you interact with low-level libraries, you must not pattern
match on the `File a` type. Instead, you should only use the saved
<code><a href="HSFM-FileSystem-FileType.html#v:path">path</a></code> and make no assumptions about the file the path might or
might not point to.</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:File">File</a> a<ul class="subs"><li>= <a href="#v:Failed">Failed</a> { <ul class="subs"><li><a href="#v:path">path</a> :: !(Path Abs)</li><li><a href="#v:err">err</a> :: <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO-Error.html#t:IOError">IOError</a></li></ul> }</li><li>| <a href="#v:Dir">Dir</a> { <ul class="subs"><li><a href="#v:path">path</a> :: !(Path Abs)</li><li><a href="#v:fvar">fvar</a> :: a</li></ul> }</li><li>| <a href="#v:RegFile">RegFile</a> { <ul class="subs"><li><a href="#v:path">path</a> :: !(Path Abs)</li><li><a href="#v:fvar">fvar</a> :: a</li></ul> }</li><li>| <a href="#v:SymLink">SymLink</a> { <ul class="subs"><li><a href="#v:path">path</a> :: !(Path Abs)</li><li><a href="#v:fvar">fvar</a> :: a</li><li><a href="#v:sdest">sdest</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> a</li><li><a href="#v:rawdest">rawdest</a> :: !<a href="https://hackage.haskell.org/package/bytestring-0.10.8.1/docs/Data-ByteString.html#t:ByteString">ByteString</a></li></ul> }</li><li>| <a href="#v:BlockDev">BlockDev</a> { <ul class="subs"><li><a href="#v:path">path</a> :: !(Path Abs)</li><li><a href="#v:fvar">fvar</a> :: a</li></ul> }</li><li>| <a href="#v:CharDev">CharDev</a> { <ul class="subs"><li><a href="#v:path">path</a> :: !(Path Abs)</li><li><a href="#v:fvar">fvar</a> :: a</li></ul> }</li><li>| <a href="#v:NamedPipe">NamedPipe</a> { <ul class="subs"><li><a href="#v:path">path</a> :: !(Path Abs)</li><li><a href="#v:fvar">fvar</a> :: a</li></ul> }</li><li>| <a href="#v:Socket">Socket</a> { <ul class="subs"><li><a href="#v:path">path</a> :: !(Path Abs)</li><li><a href="#v:fvar">fvar</a> :: a</li></ul> }</li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:FileInfo">FileInfo</a> = <a href="#v:FileInfo">FileInfo</a> {<ul class="subs"><li><a href="#v:deviceID">deviceID</a> :: !<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:DeviceID">DeviceID</a></li><li><a href="#v:fileID">fileID</a> :: !<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:FileID">FileID</a></li><li><a href="#v:fileMode">fileMode</a> :: !<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:FileMode">FileMode</a></li><li><a href="#v:linkCount">linkCount</a> :: !<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:LinkCount">LinkCount</a></li><li><a href="#v:fileOwner">fileOwner</a> :: !<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:UserID">UserID</a></li><li><a href="#v:fileGroup">fileGroup</a> :: !<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:GroupID">GroupID</a></li><li><a href="#v:specialDeviceID">specialDeviceID</a> :: !<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:DeviceID">DeviceID</a></li><li><a href="#v:fileSize">fileSize</a> :: !<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:FileOffset">FileOffset</a></li><li><a href="#v:accessTime">accessTime</a> :: !<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:EpochTime">EpochTime</a></li><li><a href="#v:modificationTime">modificationTime</a> :: !<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:EpochTime">EpochTime</a></li><li><a href="#v:statusChangeTime">statusChangeTime</a> :: !<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:EpochTime">EpochTime</a></li><li><a href="#v:accessTimeHiRes">accessTimeHiRes</a> :: !<a href="https://hackage.haskell.org/package/time-1.6.0.1/docs/Data-Time-Clock-POSIX.html#t:POSIXTime">POSIXTime</a></li><li><a hr
2016-06-01 17:32:51 +00:00
The free type variable is used in the File/Dir constructor and can hold
Handles, Strings representing a file's contents or anything else you can
think of. We catch any IO errors in the Failed constructor.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Failed" class="def">Failed</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:path" class="def">path</a> :: !(Path Abs)</dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:err" class="def">err</a> :: <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO-Error.html#t:IOError">IOError</a></dfn><div class="doc empty">&nbsp;</div></li></ul></div></td></tr><tr><td class="src"><a id="v:Dir" class="def">Dir</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:path" class="def">path</a> :: !(Path Abs)</dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:fvar" class="def">fvar</a> :: a</dfn><div class="doc empty">&nbsp;</div></li></ul></div></td></tr><tr><td class="src"><a id="v:RegFile" class="def">RegFile</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:path" class="def">path</a> :: !(Path Abs)</dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:fvar" class="def">fvar</a> :: a</dfn><div class="doc empty">&nbsp;</div></li></ul></div></td></tr><tr><td class="src"><a id="v:SymLink" class="def">SymLink</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:path" class="def">path</a> :: !(Path Abs)</dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:fvar" class="def">fvar</a> :: a</dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:sdest" class="def">sdest</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> a</dfn><div class="doc"><p>symlink madness,
we need to know where it points to</p></div></li><li><dfn class="src"><a id="v:rawdest" class="def">rawdest</a> :: !<a href="https://hackage.haskell.org/package/bytestring-0.10.8.1/docs/Data-ByteString.html#t:ByteString">ByteString</a></dfn><div class="doc empty">&nbsp;</div></li></ul></div></td></tr><tr><td class="src"><a id="v:BlockDev" class="def">BlockDev</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:path" class="def">path</a> :: !(Path Abs)</dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:fvar" class="def">fvar</a> :: a</dfn><div class="doc empty">&nbsp;</div></li></ul></div></td></tr><tr><td class="src"><a id="v:CharDev" class="def">CharDev</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:path" class="def">path</a> :: !(Path Abs)</dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:fvar" class="def">fvar</a> :: a</dfn><div class="doc empty">&nbsp;</div></li></ul></div></td></tr><tr><td class="src"><a id="v:NamedPipe" class="def">NamedPipe</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:path" class="def">path</a> :: !(Path Abs)</dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:fvar" class="def">fvar</a> :: a</dfn><div class="doc empty">&nbsp;</div></li></ul></div></td></tr><tr><td class="src"><a id="v:Socket" class="def">Socket</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:path" class="def">path</a> :: !(Path Abs)</dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:fvar" class="def">fvar</a> :: a</dfn><div class="doc empty">&nbsp;</div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:File" class="caption collapser" onclick="toggleSection('i:File')">Instances</p><div id="section.i:File" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:File:Eq:1" class="instance expander" onclick="toggleSection('i:id:File:Eq:1')"></span> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Eq.html#t:Eq">Eq</a> a =&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Eq.html#t:Eq">Eq</a> (<a href="HSFM-FileSystem-FileType.html#t:File">File</a> a)</span> <a href="src/HSFM-FileSystem-FileType.html#line-137" class="link">Source</a> <a href="#t:File" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:File: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="HSFM-FileSystem-FileType.html#t:File">File</a> a -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> a -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> a -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> a -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:File:Ord:2" class="instance expander" onclick="toggleSection('i:id:File:Ord:2')"></span> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Ord.html#t:Ord">Ord</a> (<a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a>)</span> <a href="src/HSFM-FileSystem-FileType.html#line-282" class="link">Source</a> <a href="#t:File" class="selflink">#</a></td><td class="doc
2016-06-01 17:32:51 +00:00
Then compare <code>name</code>...
Then compare free variable parameter of <code><a href="HSFM-FileSystem-FileType.html#t:File">File</a></code> constructors</p></td></tr><tr><td colspan="2"><div id="section.i:id:File:Ord:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:compare">compare</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Ord.html#t:Ordering">Ordering</a> <a href="#v:compare" class="selflink">#</a></p><p class="src"><a href="#v:-60-">(&lt;)</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60-" class="selflink">#</a></p><p class="src"><a href="#v:-60--61-">(&lt;=)</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62-">(&gt;)</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62-" class="selflink">#</a></p><p class="src"><a href="#v:-62--61-">(&gt;=)</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62--61-" class="selflink">#</a></p><p class="src"><a href="#v:max">max</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> <a href="#v:max" class="selflink">#</a></p><p class="src"><a href="#v:min">min</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> <a href="#v:min" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:File:Show:3" class="instance expander" onclick="toggleSection('i:id:File:Show:3')"></span> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Text-Show.html#t:Show">Show</a> a =&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Text-Show.html#t:Show">Show</a> (<a href="HSFM-FileSystem-FileType.html#t:File">File</a> a)</span> <a href="src/HSFM-FileSystem-FileType.html#line-137" class="link">Source</a> <a href="#t:File" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:File:Show:3" class="inst-deta
2016-06-01 17:32:51 +00:00
Then compare <code>name</code>...
Then compare free variable parameter of <code><a href="HSFM-FileSystem-FileType.html#t:File">File</a></code> constructors</p></td></tr><tr><td colspan="2"><div id="section.i:id:FileInfo:Ord:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:compare">compare</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Ord.html#t:Ordering">Ordering</a> <a href="#v:compare" class="selflink">#</a></p><p class="src"><a href="#v:-60-">(&lt;)</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60-" class="selflink">#</a></p><p class="src"><a href="#v:-60--61-">(&lt;=)</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62-">(&gt;)</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62-" class="selflink">#</a></p><p class="src"><a href="#v:-62--61-">(&gt;=)</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62--61-" class="selflink">#</a></p><p class="src"><a href="#v:max">max</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> <a href="#v:max" class="selflink">#</a></p><p class="src"><a href="#v:min">min</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> <a href="#v:min" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:sfileLike" class="def">sfileLike</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; (<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a>, <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a>) <a href="src/HSFM-FileSystem-FileType.html#sfileLike" class="link">Source</a> <a href="#v:sfileLike" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:fileLike" class="def">fileLike</a>
pointing to such.</p></div></div><div class="top"><p class="src"><a id="v:brokenSymlink" class="def">brokenSymlink</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; (<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a>, <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a>) <a href="src/HSFM-FileSystem-FileType.html#brokenSymlink" class="link">Source</a> <a href="#v:brokenSymlink" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:fileLikeSym" class="def">fileLikeSym</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; (<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a>, <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a>) <a href="src/HSFM-FileSystem-FileType.html#fileLikeSym" class="link">Source</a> <a href="#v:fileLikeSym" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:dirSym" class="def">dirSym</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; (<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a>, <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a>) <a href="src/HSFM-FileSystem-FileType.html#dirSym" class="link">Source</a> <a href="#v:dirSym" class="selflink">#</a></p></div><div class="top"><p class="src"><span class="keyword">pattern</span> <a id="v:FileLikeSym" class="def">FileLikeSym</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> <a href="src/HSFM-FileSystem-FileType.html#FileLikeSym" class="link">Source</a> <a href="#v:FileLikeSym" class="selflink">#</a></p><div class="doc"><p>Matches on symlinks pointing to file-like files only.</p></div></div><div class="top"><p class="src"><span class="keyword">pattern</span> <a id="v:BrokenSymlink" class="def">BrokenSymlink</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> <a href="src/HSFM-FileSystem-FileType.html#BrokenSymlink" class="link">Source</a> <a href="#v:BrokenSymlink" class="selflink">#</a></p><div class="doc"><p>Matches on broken symbolic links.</p></div></div><div class="top"><p class="src"><span class="keyword">pattern</span> <a id="v:DirOrSym" class="def">DirOrSym</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> <a href="src/HSFM-FileSystem-FileType.html#DirOrSym" class="link">Source</a> <a href="#v:DirOrSym" class="selflink">#</a></p><div class="doc"><p>Matches on directories or symlinks pointing to directories.
2016-06-01 17:32:51 +00:00
If the symlink is pointing to a symlink pointing to a directory, then
it will return True, but also return the first element in the symlink-
chain, not the last.</p></div></div><div class="top"><p class="src"><span class="keyword">pattern</span> <a id="v:DirSym" class="def">DirSym</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> <a href="src/HSFM-FileSystem-FileType.html#DirSym" class="link">Source</a> <a href="#v:DirSym" class="selflink">#</a></p><div class="doc"><p>Matches on symlinks pointing to directories only.</p></div></div><div class="top"><p class="src"><span class="keyword">pattern</span> <a id="v:FileLikeOrSym" class="def">FileLikeOrSym</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> <a href="src/HSFM-FileSystem-FileType.html#FileLikeOrSym" class="link">Source</a> <a href="#v:FileLikeOrSym" class="selflink">#</a></p><div class="doc"><p>Matches on any non-directory kind of files or symlinks pointing to
2016-06-01 17:32:51 +00:00
such.
If the symlink is pointing to a symlink pointing to such a file, then
it will return True, but also return the first element in the symlink-
chain, not the last.</p></div></div><div class="top"><p class="src"><a id="v:readFile" class="def">readFile</a> :: (Path Abs -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> a) -&gt; Path Abs -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (<a href="HSFM-FileSystem-FileType.html#t:File">File</a> a) <a href="src/HSFM-FileSystem-FileType.html#readFile" class="link">Source</a> <a href="#v:readFile" class="selflink">#</a></p><div class="doc"><p>Reads a file or directory Path into an <code>AnchoredFile</code>, filling the free
variables via the given function.</p></div></div><div class="top"><p class="src"><a id="v:readDirectoryContents" class="def">readDirectoryContents</a> <a href="src/HSFM-FileSystem-FileType.html#readDirectoryContents" class="link">Source</a> <a href="#v:readDirectoryContents" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (Path Abs -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> a)</td><td class="doc"><p>fills free a variable</p></td></tr><tr><td class="src">-&gt; Path Abs</td><td class="doc"><p>path to read</p></td></tr><tr><td class="src">-&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [<a href="HSFM-FileSystem-FileType.html#t:File">File</a> a]</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Get the contents of a given directory and return them as a list
of <code>AnchoredFile</code>.</p></div></div><div class="top"><p class="src"><a id="v:getContents" class="def">getContents</a> :: (Path Abs -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> a) -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [<a href="HSFM-FileSystem-FileType.html#t:File">File</a> a] <a href="src/HSFM-FileSystem-FileType.html#getContents" class="link">Source</a> <a href="#v:getContents" class="selflink">#</a></p><div class="doc"><p>A variant of <code><a href="HSFM-FileSystem-FileType.html#v:readDirectoryContents">readDirectoryContents</a></code> where the second argument
is a <code><a href="HSFM-FileSystem-FileType.html#t:File">File</a></code>. If a non-directory is passed returns an empty list.</p></div></div><div class="top"><p class="src"><a id="v:goUp" class="def">goUp</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (<a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a>) <a href="src/HSFM-FileSystem-FileType.html#goUp" class="link">Source</a> <a href="#v:goUp" class="selflink">#</a></p><div class="doc"><p>Go up one directory in the filesystem hierarchy.</p></div></div><div class="top"><p class="src"><a id="v:goUp-39-" class="def">goUp'</a> :: Path Abs -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (<a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a>) <a href="src/HSFM-FileSystem-FileType.html#goUp%27" class="link">Source</a> <a href="#v:goUp-39-" class="selflink">#</a></p><div class="doc"><p>Go up one directory in the filesystem hierarchy.</p></div></div><div class="top"><p class="src"><a id="v:anyFailed" class="def">anyFailed</a> :: [<a href="HSFM-FileSystem-FileType.html#t:File">File</a> a] -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HSFM-FileSystem-FileType.html#anyFailed" class="link">Source</a> <a href="#v:anyFailed" class="selflink">#</a></p><div class="doc"><p>True if any Failed constructors in the tree.</p></div></div><div class="top"><p class="src"><a id="v:successful" class="def">successful</a> :: [<a href="HSFM-FileSystem-FileType.html#t:File">File</a> a] -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HSFM-FileSystem-FileType.html#successful" class="link">Source</a> <a href="#v:successful" class="selflink">#</a></p><div class="doc"><p>True if there are no Failed constructors in the tree.</p></div></div><div class="top"><p class="src"><a id="v:failed" class="def">failed</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> a -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HSFM-FileSystem-FileType.html#failed" class="link">Source</a> <a href="#v:failed" class="selflink">#</a></p><div class="doc"><p>Returns true if argument is a <code><a href="HSFM-FileSystem-FileType.html#v:Failed">Failed</a></code> constructor.</p></div></div><div class="top"><p class="src"><a id="v:failures" class="def">failures</a> :: [<a href="HSFM-FileSystem-FileType.html#t:File">File</a> a] -&gt; [<a href="HSFM-FileSystem-FileType.html#t:File">File</a> a] <a href="src/HSFM-FileSystem-FileType.html#failures" class="link">Source</a> <a href="#v:failures" class="selflink">#</a></p><div class="doc"><p>Returns a list of <code><a href="HSFM-FileSystem-FileType.html#v:Failed">Failed</a></code> constructors only.</p></div></div><div class="top"><p class="src"><a id="v:comparingConstr" class="def">comparingConstr</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Ord.html#t:Ordering">Ordering</a> <a href="src/HSFM-FileSystem-FileType.html#comparingConstr" class="link">Source</a> <a href="#v:comparingConstr" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:isFileC" class="def">isFileC</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> a -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HSFM-FileSystem-FileType.html#isFileC" class="link">Source</a> <a href="#v:isFileC" class="selfl
with a failed constructor, rethrows the IOError within.
Otherwise, returns the file unchanged.</p></div></div><div class="top"><p class="src"><a id="v:isBrokenSymlink" class="def">isBrokenSymlink</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Bool.html#t:Bool">Bool</a> <a href="src/HSFM-FileSystem-FileType.html#isBrokenSymlink" class="link">Source</a> <a href="#v:isBrokenSymlink" class="selflink">#</a></p><div class="doc"><p>Checks if a symlink is broken by examining the constructor of the
symlink destination.</p><p>When called on a non-symlink, returns False.</p></div></div><div class="top"><p class="src"><a id="v:packModTime" class="def">packModTime</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-String.html#t:String">String</a> <a href="src/HSFM-FileSystem-FileType.html#packModTime" class="link">Source</a> <a href="#v:packModTime" class="selflink">#</a></p><div class="doc"><p>Pack the modification time into a string.</p></div></div><div class="top"><p class="src"><a id="v:packAccessTime" class="def">packAccessTime</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-String.html#t:String">String</a> <a href="src/HSFM-FileSystem-FileType.html#packAccessTime" class="link">Source</a> <a href="#v:packAccessTime" class="selflink">#</a></p><div class="doc"><p>Pack the modification time into a string.</p></div></div><div class="top"><p class="src"><a id="v:epochToString" class="def">epochToString</a> :: <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-Posix-Types.html#t:EpochTime">EpochTime</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-String.html#t:String">String</a> <a href="src/HSFM-FileSystem-FileType.html#epochToString" class="link">Source</a> <a href="#v:epochToString" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:packPermissions" class="def">packPermissions</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> <a href="HSFM-FileSystem-FileType.html#t:FileInfo">FileInfo</a> -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-String.html#t:String">String</a> <a href="src/HSFM-FileSystem-FileType.html#packPermissions" class="link">Source</a> <a href="#v:packPermissions" class="selflink">#</a></p><div class="doc"><p>Pack the permissions into a string, similar to what &quot;ls -l&quot; does.</p></div></div><div class="top"><p class="src"><a id="v:packFileType" class="def">packFileType</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> a -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-String.html#t:String">String</a> <a href="src/HSFM-FileSystem-FileType.html#packFileType" class="link">Source</a> <a href="#v:packFileType" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:packLinkDestination" class="def">packLinkDestination</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> a -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Maybe.html#t:Maybe">Maybe</a> <a href="https://hackage.haskell.org/package/bytestring-0.10.8.1/docs/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/HSFM-FileSystem-FileType.html#packLinkDestination" class="link">Source</a> <a href="#v:packLinkDestination" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:fromFreeVar" class="def">fromFreeVar</a> :: Default d =&gt; (a -&gt; d) -&gt; <a href="HSFM-FileSystem-FileType.html#t:File">File</a> a -&gt; d <a href="src/HSFM-FileSystem-FileType.html#fromFreeVar" class="link">Source</a> <a href="#v:fromFreeVar" class="selflink">#</a></p><div class="doc"><p>Apply a function on the free variable. If there is no free variable
for the given constructor the value from the <code>Default</code> class is used.</p></div></div><div class="top"><p class="src"><a id="v:getFPasStr" class="def">getFPasStr</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> a -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-String.html#t:String">String</a> <a href="src/HSFM-FileSystem-FileType.html#getFPasStr" class="link">Source</a> <a href="#v:getFPasStr" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:getFreeVar" class="def">getFreeVar</a> :: <a href="HSFM-FileSystem-FileType.html#t:File">File</a> a -&gt; <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Maybe.html#t:Maybe">Maybe</a> a <a href="src/HSFM-FileSystem-FileType.html#getFreeVar" class="link">Source</a> <a href="#v:getFreeVar" class="selflink">#</a></p><div class="doc"><p>Gets the free variable. Returns Nothing if the constructor is of <code><a href="HSFM-FileSystem-FileType.html#v:Failed">Failed</a></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>