Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 2738

ghc-7.4.2-4.mga5.i586.rpm

<!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.FilePath.Posix</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_System-FilePath-Posix.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">filepath-1.3.0.0: Library for manipulating FilePaths in a cross platform way.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Stability</th><td>stable</td></tr><tr><th>Maintainer</th><td>libraries@haskell.org</td></tr><tr><th>Safe Haskell</th><td>Safe</td></tr></table><p class="caption">System.FilePath.Posix</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Separator predicates
</a></li><li><a href="#g:2">Path methods (environment $PATH)
</a></li><li><a href="#g:3">Extension methods
</a></li><li><a href="#g:4">Drive methods
</a></li><li><a href="#g:5">Operations on a FilePath, as a list of directories
</a></li><li><a href="#g:6">Low level FilePath operators
</a></li><li><a href="#g:7">File name manipulators
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A library for FilePath manipulations, using Posix style paths on
 all platforms. Importing <a href="System-FilePath.html">System.FilePath</a> is usually better.
</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">type</span> <a href="#t:FilePath">FilePath</a> = <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:pathSeparator">pathSeparator</a> :: <a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a></li><li class="src short"><a href="#v:pathSeparators">pathSeparators</a> :: [<a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a>]</li><li class="src short"><a href="#v:isPathSeparator">isPathSeparator</a> :: <a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:searchPathSeparator">searchPathSeparator</a> :: <a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a></li><li class="src short"><a href="#v:isSearchPathSeparator">isSearchPathSeparator</a> :: <a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:extSeparator">extSeparator</a> :: <a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a></li><li class="src short"><a href="#v:isExtSeparator">isExtSeparator</a> :: <a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:splitSearchPath">splitSearchPath</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; [<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>]</li><li class="src short"><a href="#v:getSearchPath">getSearchPath</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>]</li><li class="src short"><a href="#v:splitExtension">splitExtension</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; (<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>, <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>)</li><li class="src short"><a href="#v:takeExtension">takeExtension</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:replaceExtension">replaceExtension</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:dropExtension">dropExtension</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:addExtension">addExtension</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:hasExtension">hasExtension</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:-60-.-62-">(&lt;.&gt;)</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:splitExtensions">splitExtensions</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; (<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>, <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>)</li><li class="src short"><a href="#v:dropExtensions">dropExtensions</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:takeExtensions">takeExtensions</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:splitDrive">splitDrive</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; (<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>, <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>)</li><li class="src short"><a href="#v:joinDrive">joinDrive</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:takeDrive">takeDrive</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:hasDrive">hasDrive</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:dropDrive">dropDrive</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:isDrive">isDrive</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:splitFileName">splitFileName</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; (<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>, <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>)</li><li class="src short"><a href="#v:takeFileName">takeFileName</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:replaceFileName">replaceFileName</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:dropFileName">dropFileName</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:takeBaseName">takeBaseName</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:replaceBaseName">replaceBaseName</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:takeDirectory">takeDirectory</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:replaceDirectory">replaceDirectory</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:combine">combine</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:-60--47--62-">(&lt;/&gt;)</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:splitPath">splitPath</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; [<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>]</li><li class="src short"><a href="#v:joinPath">joinPath</a> :: [<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>] -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:splitDirectories">splitDirectories</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; [<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>]</li><li class="src short"><a href="#v:hasTrailingPathSeparator">hasTrailingPathSeparator</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:addTrailingPathSeparator">addTrailingPathSeparator</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:dropTrailingPathSeparator">dropTrailingPathSeparator</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:normalise">normalise</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:equalFilePath">equalFilePath</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:makeRelative">makeRelative</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:isRelative">isRelative</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isAbsolute">isAbsolute</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isValid">isValid</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:makeValid">makeValid</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></li></ul></div><div id="interface"><h1 id="g:1">Separator predicates
</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:FilePath" class="def">FilePath</a> = <a href="../base-4.5.1.0/Data-String.html#t:String">String</a><a href="../base-4.5.1.0/src/GHC-IO.html#FilePath" class="link">Source</a></p><div class="doc"><p>File and directory names are values of type <code><a href="../base-4.5.1.0/Data-String.html#t:String">String</a></code>, whose precise
 meaning is operating system dependent. Files can be opened, yielding a
 handle which can then be used to operate on the contents of that file.
</p></div></div><div class="top"><p class="src"><a name="v:pathSeparator" class="def">pathSeparator</a> :: <a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a></p><div class="doc"><p>The character that separates directories. In the case where more than
   one character is possible, <code><a href="System-FilePath-Posix.html#v:pathSeparator">pathSeparator</a></code> is the 'ideal' one.
</p><pre> Windows: pathSeparator == '\\'
 Posix:   pathSeparator ==  '/'
 isPathSeparator pathSeparator
</pre></div></div><div class="top"><p class="src"><a name="v:pathSeparators" class="def">pathSeparators</a> :: [<a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a>]</p><div class="doc"><p>The list of all possible separators.
</p><pre> Windows: pathSeparators == ['\\', '/']
 Posix:   pathSeparators == ['/']
 pathSeparator `elem` pathSeparators
</pre></div></div><div class="top"><p class="src"><a name="v:isPathSeparator" class="def">isPathSeparator</a> :: <a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Rather than using <code>(== <code><a href="System-FilePath-Posix.html#v:pathSeparator">pathSeparator</a></code>)</code>, use this. Test if something
   is a path separator.
</p><pre> isPathSeparator a == (a `elem` pathSeparators)
</pre></div></div><div class="top"><p class="src"><a name="v:searchPathSeparator" class="def">searchPathSeparator</a> :: <a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a></p><div class="doc"><p>The character that is used to separate the entries in the $PATH environment variable.
</p><pre> Windows: searchPathSeparator == ';'
 Posix:   searchPathSeparator == ':'
</pre></div></div><div class="top"><p class="src"><a name="v:isSearchPathSeparator" class="def">isSearchPathSeparator</a> :: <a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Is the character a file separator?
</p><pre> isSearchPathSeparator a == (a == searchPathSeparator)
</pre></div></div><div class="top"><p class="src"><a name="v:extSeparator" class="def">extSeparator</a> :: <a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a></p><div class="doc"><p>File extension character
</p><pre> extSeparator == '.'
</pre></div></div><div class="top"><p class="src"><a name="v:isExtSeparator" class="def">isExtSeparator</a> :: <a href="../base-4.5.1.0/Data-Char.html#t:Char">Char</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Is the character an extension character?
</p><pre> isExtSeparator a == (a == extSeparator)
</pre></div></div><h1 id="g:2">Path methods (environment $PATH)
</h1><div class="top"><p class="src"><a name="v:splitSearchPath" class="def">splitSearchPath</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; [<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>]</p><div class="doc"><p>Take a string, split it on the <code><a href="System-FilePath-Posix.html#v:searchPathSeparator">searchPathSeparator</a></code> character.
</p><p>Follows the recommendations in
   <a href="http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html">http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html</a>
</p><pre> Posix:   splitSearchPath &quot;File1:File2:File3&quot;  == [&quot;File1&quot;,&quot;File2&quot;,&quot;File3&quot;]
 Posix:   splitSearchPath &quot;File1::File2:File3&quot; == [&quot;File1&quot;,&quot;.&quot;,&quot;File2&quot;,&quot;File3&quot;]
 Windows: splitSearchPath &quot;File1;File2;File3&quot;  == [&quot;File1&quot;,&quot;File2&quot;,&quot;File3&quot;]
 Windows: splitSearchPath &quot;File1;;File2;File3&quot; == [&quot;File1&quot;,&quot;File2&quot;,&quot;File3&quot;]
</pre></div></div><div class="top"><p class="src"><a name="v:getSearchPath" class="def">getSearchPath</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>]</p><div class="doc"><p>Get a list of filepaths in the $PATH.
</p></div></div><h1 id="g:3">Extension methods
</h1><div class="top"><p class="src"><a name="v:splitExtension" class="def">splitExtension</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; (<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>, <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>)</p><div class="doc"><p>Split on the extension. <code><a href="System-FilePath-Posix.html#v:addExtension">addExtension</a></code> is the inverse.
</p><pre> uncurry (++) (splitExtension x) == x
 uncurry addExtension (splitExtension x) == x
 splitExtension &quot;file.txt&quot; == (&quot;file&quot;,&quot;.txt&quot;)
 splitExtension &quot;file&quot; == (&quot;file&quot;,&quot;&quot;)
 splitExtension &quot;file/file.txt&quot; == (&quot;file/file&quot;,&quot;.txt&quot;)
 splitExtension &quot;file.txt/boris&quot; == (&quot;file.txt/boris&quot;,&quot;&quot;)
 splitExtension &quot;file.txt/boris.ext&quot; == (&quot;file.txt/boris&quot;,&quot;.ext&quot;)
 splitExtension &quot;file/path.txt.bob.fred&quot; == (&quot;file/path.txt.bob&quot;,&quot;.fred&quot;)
 splitExtension &quot;file/path.txt/&quot; == (&quot;file/path.txt/&quot;,&quot;&quot;)
</pre></div></div><div class="top"><p class="src"><a name="v:takeExtension" class="def">takeExtension</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></p><div class="doc"><p>Get the extension of a file, returns <code>&quot;&quot;</code> for no extension, <code>.ext</code> otherwise.
</p><pre> takeExtension x == snd (splitExtension x)
 Valid x =&gt; takeExtension (addExtension x &quot;ext&quot;) == &quot;.ext&quot;
 Valid x =&gt; takeExtension (replaceExtension x &quot;ext&quot;) == &quot;.ext&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:replaceExtension" class="def">replaceExtension</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Set the extension of a file, overwriting one if already present.
</p><pre> replaceExtension &quot;file.txt&quot; &quot;.bob&quot; == &quot;file.bob&quot;
 replaceExtension &quot;file.txt&quot; &quot;bob&quot; == &quot;file.bob&quot;
 replaceExtension &quot;file&quot; &quot;.bob&quot; == &quot;file.bob&quot;
 replaceExtension &quot;file.txt&quot; &quot;&quot; == &quot;file&quot;
 replaceExtension &quot;file.fred.bob&quot; &quot;txt&quot; == &quot;file.fred.txt&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:dropExtension" class="def">dropExtension</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Remove last extension, and the &quot;.&quot; preceding it.
</p><pre> dropExtension x == fst (splitExtension x)
</pre></div></div><div class="top"><p class="src"><a name="v:addExtension" class="def">addExtension</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Add an extension, even if there is already one there.
   E.g. <code>addExtension &quot;foo.txt&quot; &quot;bat&quot; -&gt; &quot;foo.txt.bat&quot;</code>.
</p><pre> addExtension &quot;file.txt&quot; &quot;bib&quot; == &quot;file.txt.bib&quot;
 addExtension &quot;file.&quot; &quot;.bib&quot; == &quot;file..bib&quot;
 addExtension &quot;file&quot; &quot;.bib&quot; == &quot;file.bib&quot;
 addExtension &quot;/&quot; &quot;x&quot; == &quot;/.x&quot;
 Valid x =&gt; takeFileName (addExtension (addTrailingPathSeparator x) &quot;ext&quot;) == &quot;.ext&quot;
 Windows: addExtension &quot;\\\\share&quot; &quot;.txt&quot; == &quot;\\\\share\\.txt&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:hasExtension" class="def">hasExtension</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Does the given filename have an extension?
</p><pre> null (takeExtension x) == not (hasExtension x)
</pre></div></div><div class="top"><p class="src"><a name="v:-60-.-62-" class="def">(&lt;.&gt;)</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Alias to <code><a href="System-FilePath-Posix.html#v:addExtension">addExtension</a></code>, for people who like that sort of thing.
</p></div></div><div class="top"><p class="src"><a name="v:splitExtensions" class="def">splitExtensions</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; (<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>, <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>)</p><div class="doc"><p>Split on all extensions
</p><pre> uncurry (++) (splitExtensions x) == x
 uncurry addExtension (splitExtensions x) == x
 splitExtensions &quot;file.tar.gz&quot; == (&quot;file&quot;,&quot;.tar.gz&quot;)
</pre></div></div><div class="top"><p class="src"><a name="v:dropExtensions" class="def">dropExtensions</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Drop all extensions
</p><pre> not $ hasExtension (dropExtensions x)
</pre></div></div><div class="top"><p class="src"><a name="v:takeExtensions" class="def">takeExtensions</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></p><div class="doc"><p>Get all extensions
</p><pre> takeExtensions &quot;file.tar.gz&quot; == &quot;.tar.gz&quot;
</pre></div></div><h1 id="g:4">Drive methods
</h1><div class="top"><p class="src"><a name="v:splitDrive" class="def">splitDrive</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; (<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>, <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>)</p><div class="doc"><p>Split a path into a drive and a path.
   On Unix, / is a Drive.
</p><pre> uncurry (++) (splitDrive x) == x
 Windows: splitDrive &quot;file&quot; == (&quot;&quot;,&quot;file&quot;)
 Windows: splitDrive &quot;c:/file&quot; == (&quot;c:/&quot;,&quot;file&quot;)
 Windows: splitDrive &quot;c:\\file&quot; == (&quot;c:\\&quot;,&quot;file&quot;)
 Windows: splitDrive &quot;\\\\shared\\test&quot; == (&quot;\\\\shared\\&quot;,&quot;test&quot;)
 Windows: splitDrive &quot;\\\\shared&quot; == (&quot;\\\\shared&quot;,&quot;&quot;)
 Windows: splitDrive &quot;\\\\?\\UNC\\shared\\file&quot; == (&quot;\\\\?\\UNC\\shared\\&quot;,&quot;file&quot;)
 Windows: splitDrive &quot;\\\\?\\UNCshared\\file&quot; == (&quot;\\\\?\\&quot;,&quot;UNCshared\\file&quot;)
 Windows: splitDrive &quot;\\\\?\\d:\\file&quot; == (&quot;\\\\?\\d:\\&quot;,&quot;file&quot;)
 Windows: splitDrive &quot;/d&quot; == (&quot;&quot;,&quot;/d&quot;)
 Posix:   splitDrive &quot;/test&quot; == (&quot;/&quot;,&quot;test&quot;)
 Posix:   splitDrive &quot;//test&quot; == (&quot;//&quot;,&quot;test&quot;)
 Posix:   splitDrive &quot;test/file&quot; == (&quot;&quot;,&quot;test/file&quot;)
 Posix:   splitDrive &quot;file&quot; == (&quot;&quot;,&quot;file&quot;)
</pre></div></div><div class="top"><p class="src"><a name="v:joinDrive" class="def">joinDrive</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Join a drive and the rest of the path.
</p><pre>          uncurry joinDrive (splitDrive x) == x
 Windows: joinDrive &quot;C:&quot; &quot;foo&quot; == &quot;C:foo&quot;
 Windows: joinDrive &quot;C:\\&quot; &quot;bar&quot; == &quot;C:\\bar&quot;
 Windows: joinDrive &quot;\\\\share&quot; &quot;foo&quot; == &quot;\\\\share\\foo&quot;
 Windows: joinDrive &quot;/:&quot; &quot;foo&quot; == &quot;/:\\foo&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:takeDrive" class="def">takeDrive</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Get the drive from a filepath.
</p><pre> takeDrive x == fst (splitDrive x)
</pre></div></div><div class="top"><p class="src"><a name="v:hasDrive" class="def">hasDrive</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Does a path have a drive.
</p><pre> not (hasDrive x) == null (takeDrive x)
</pre></div></div><div class="top"><p class="src"><a name="v:dropDrive" class="def">dropDrive</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Delete the drive, if it exists.
</p><pre> dropDrive x == snd (splitDrive x)
</pre></div></div><div class="top"><p class="src"><a name="v:isDrive" class="def">isDrive</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Is an element a drive
</p></div></div><h1 id="g:5">Operations on a FilePath, as a list of directories
</h1><div class="top"><p class="src"><a name="v:splitFileName" class="def">splitFileName</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; (<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>, <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>)</p><div class="doc"><p>Split a filename into directory and file. <code><a href="System-FilePath-Posix.html#v:combine">combine</a></code> is the inverse.
</p><pre> Valid x =&gt; uncurry (&lt;/&gt;) (splitFileName x) == x || fst (splitFileName x) == &quot;./&quot;
 Valid x =&gt; isValid (fst (splitFileName x))
 splitFileName &quot;file/bob.txt&quot; == (&quot;file/&quot;, &quot;bob.txt&quot;)
 splitFileName &quot;file/&quot; == (&quot;file/&quot;, &quot;&quot;)
 splitFileName &quot;bob&quot; == (&quot;./&quot;, &quot;bob&quot;)
 Posix:   splitFileName &quot;/&quot; == (&quot;/&quot;,&quot;&quot;)
 Windows: splitFileName &quot;c:&quot; == (&quot;c:&quot;,&quot;&quot;)
</pre></div></div><div class="top"><p class="src"><a name="v:takeFileName" class="def">takeFileName</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Get the file name.
</p><pre> takeFileName &quot;test/&quot; == &quot;&quot;
 takeFileName x `isSuffixOf` x
 takeFileName x == snd (splitFileName x)
 Valid x =&gt; takeFileName (replaceFileName x &quot;fred&quot;) == &quot;fred&quot;
 Valid x =&gt; takeFileName (x &lt;/&gt; &quot;fred&quot;) == &quot;fred&quot;
 Valid x =&gt; isRelative (takeFileName x)
</pre></div></div><div class="top"><p class="src"><a name="v:replaceFileName" class="def">replaceFileName</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Set the filename.
</p><pre> Valid x =&gt; replaceFileName x (takeFileName x) == x
</pre></div></div><div class="top"><p class="src"><a name="v:dropFileName" class="def">dropFileName</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Drop the filename.
</p><pre> dropFileName x == fst (splitFileName x)
</pre></div></div><div class="top"><p class="src"><a name="v:takeBaseName" class="def">takeBaseName</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></p><div class="doc"><p>Get the base name, without an extension or path.
</p><pre> takeBaseName &quot;file/test.txt&quot; == &quot;test&quot;
 takeBaseName &quot;dave.ext&quot; == &quot;dave&quot;
 takeBaseName &quot;&quot; == &quot;&quot;
 takeBaseName &quot;test&quot; == &quot;test&quot;
 takeBaseName (addTrailingPathSeparator x) == &quot;&quot;
 takeBaseName &quot;file/file.tar.gz&quot; == &quot;file.tar&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:replaceBaseName" class="def">replaceBaseName</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Set the base name.
</p><pre> replaceBaseName &quot;file/test.txt&quot; &quot;bob&quot; == &quot;file/bob.txt&quot;
 replaceBaseName &quot;fred&quot; &quot;bill&quot; == &quot;bill&quot;
 replaceBaseName &quot;/dave/fred/bob.gz.tar&quot; &quot;new&quot; == &quot;/dave/fred/new.tar&quot;
 Valid x =&gt; replaceBaseName x (takeBaseName x) == x
</pre></div></div><div class="top"><p class="src"><a name="v:takeDirectory" class="def">takeDirectory</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Get the directory name, move up one level.
</p><pre>           takeDirectory x `isPrefixOf` x || takeDirectory x == &quot;.&quot;
           takeDirectory &quot;foo&quot; == &quot;.&quot;
           takeDirectory &quot;/foo/bar/baz&quot; == &quot;/foo/bar&quot;
           takeDirectory &quot;/foo/bar/baz/&quot; == &quot;/foo/bar/baz&quot;
           takeDirectory &quot;foo/bar/baz&quot; == &quot;foo/bar&quot;
 Windows:  takeDirectory &quot;foo\\bar&quot; == &quot;foo&quot;
 Windows:  takeDirectory &quot;foo\\bar\\\\&quot; == &quot;foo\\bar&quot;
 Windows:  takeDirectory &quot;C:\\&quot; == &quot;C:\\&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:replaceDirectory" class="def">replaceDirectory</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Set the directory, keeping the filename the same.
</p><pre> Valid x =&gt; replaceDirectory x (takeDirectory x) `equalFilePath` x
</pre></div></div><div class="top"><p class="src"><a name="v:combine" class="def">combine</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Combine two paths, if the second path <code><a href="System-FilePath-Posix.html#v:isAbsolute">isAbsolute</a></code>, then it returns the second.
</p><pre> Valid x =&gt; combine (takeDirectory x) (takeFileName x) `equalFilePath` x
 Posix:   combine &quot;/&quot; &quot;test&quot; == &quot;/test&quot;
 Posix:   combine &quot;home&quot; &quot;bob&quot; == &quot;home/bob&quot;
 Windows: combine &quot;home&quot; &quot;bob&quot; == &quot;home\\bob&quot;
 Windows: combine &quot;home&quot; &quot;/bob&quot; == &quot;/bob&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:-60--47--62-" class="def">(&lt;/&gt;)</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>A nice alias for <code><a href="System-FilePath-Posix.html#v:combine">combine</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:splitPath" class="def">splitPath</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; [<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>]</p><div class="doc"><p>Split a path by the directory separator.
</p><pre> concat (splitPath x) == x
 splitPath &quot;test//item/&quot; == [&quot;test//&quot;,&quot;item/&quot;]
 splitPath &quot;test/item/file&quot; == [&quot;test/&quot;,&quot;item/&quot;,&quot;file&quot;]
 splitPath &quot;&quot; == []
 Windows: splitPath &quot;c:\\test\\path&quot; == [&quot;c:\\&quot;,&quot;test\\&quot;,&quot;path&quot;]
 Posix:   splitPath &quot;/file/test&quot; == [&quot;/&quot;,&quot;file/&quot;,&quot;test&quot;]
</pre></div></div><div class="top"><p class="src"><a name="v:joinPath" class="def">joinPath</a> :: [<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>] -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Join path elements back together.
</p><pre> Valid x =&gt; joinPath (splitPath x) == x
 joinPath [] == &quot;&quot;
 Posix: joinPath [&quot;test&quot;,&quot;file&quot;,&quot;path&quot;] == &quot;test/file/path&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:splitDirectories" class="def">splitDirectories</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; [<a href="System-FilePath-Posix.html#t:FilePath">FilePath</a>]</p><div class="doc"><p>Just as <code><a href="System-FilePath-Posix.html#v:splitPath">splitPath</a></code>, but don't add the trailing slashes to each element.
</p><pre> splitDirectories &quot;test/file&quot; == [&quot;test&quot;,&quot;file&quot;]
 splitDirectories &quot;/test/file&quot; == [&quot;/&quot;,&quot;test&quot;,&quot;file&quot;]
 Valid x =&gt; joinPath (splitDirectories x) `equalFilePath` x
 splitDirectories &quot;&quot; == []
</pre></div></div><h1 id="g:6">Low level FilePath operators
</h1><div class="top"><p class="src"><a name="v:hasTrailingPathSeparator" class="def">hasTrailingPathSeparator</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Is an item either a directory or the last character a path separator?
</p><pre> hasTrailingPathSeparator &quot;test&quot; == False
 hasTrailingPathSeparator &quot;test/&quot; == True
</pre></div></div><div class="top"><p class="src"><a name="v:addTrailingPathSeparator" class="def">addTrailingPathSeparator</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Add a trailing file path separator if one is not already present.
</p><pre> hasTrailingPathSeparator (addTrailingPathSeparator x)
 hasTrailingPathSeparator x ==&gt; addTrailingPathSeparator x == x
 Posix:    addTrailingPathSeparator &quot;test/rest&quot; == &quot;test/rest/&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:dropTrailingPathSeparator" class="def">dropTrailingPathSeparator</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Remove any trailing path separators
</p><pre> dropTrailingPathSeparator &quot;file/test/&quot; == &quot;file/test&quot;
 Posix:    not (hasTrailingPathSeparator (dropTrailingPathSeparator x)) || isDrive x
 Posix:    dropTrailingPathSeparator &quot;/&quot; == &quot;/&quot;
 Windows:  dropTrailingPathSeparator &quot;\\&quot; == &quot;\\&quot;
</pre></div></div><h1 id="g:7">File name manipulators
</h1><div class="top"><p class="src"><a name="v:normalise" class="def">normalise</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Normalise a file
</p><ul><li> // outside of the drive can be made blank
</li><li> / -&gt; <code><a href="System-FilePath-Posix.html#v:pathSeparator">pathSeparator</a></code>
</li><li> ./ -&gt; &quot;&quot;
</li></ul><pre> Posix:   normalise &quot;/file/\\test////&quot; == &quot;/file/\\test/&quot;
 Posix:   normalise &quot;/file/./test&quot; == &quot;/file/test&quot;
 Posix:   normalise &quot;/test/file/../bob/fred/&quot; == &quot;/test/file/../bob/fred/&quot;
 Posix:   normalise &quot;../bob/fred/&quot; == &quot;../bob/fred/&quot;
 Posix:   normalise &quot;./bob/fred/&quot; == &quot;bob/fred/&quot;
 Windows: normalise &quot;c:\\file/bob\\&quot; == &quot;C:\\file\\bob\\&quot;
 Windows: normalise &quot;c:\\&quot; == &quot;C:\\&quot;
 Windows: normalise &quot;\\\\server\\test&quot; == &quot;\\\\server\\test&quot;
 Windows: normalise &quot;c:/file&quot; == &quot;C:\\file&quot;
          normalise &quot;.&quot; == &quot;.&quot;
 Posix:   normalise &quot;./&quot; == &quot;./&quot;
 Posix:   normalise &quot;./.&quot; == &quot;./&quot;
 Posix:   normalise &quot;/&quot; == &quot;/&quot;
 Posix:   normalise &quot;bob/fred/.&quot; == &quot;bob/fred/&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:equalFilePath" class="def">equalFilePath</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Equality of two <code><a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></code>s.
   If you call <code>System.Directory.canonicalizePath</code>
   first this has a much better chance of working.
   Note that this doesn't follow symlinks or DOSNAM~1s.
</p><pre>          x == y ==&gt; equalFilePath x y
          normalise x == normalise y ==&gt; equalFilePath x y
 Posix:   equalFilePath &quot;foo&quot; &quot;foo/&quot;
 Posix:   not (equalFilePath &quot;foo&quot; &quot;/foo&quot;)
 Posix:   not (equalFilePath &quot;foo&quot; &quot;FOO&quot;)
 Windows: equalFilePath &quot;foo&quot; &quot;FOO&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:makeRelative" class="def">makeRelative</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Contract a filename, based on a relative path.
</p><p>There is no corresponding <code>makeAbsolute</code> function, instead use
   <code>System.Directory.canonicalizePath</code> which has the same effect.
</p><pre>          Valid y =&gt; equalFilePath x y || (isRelative x &amp;&amp; makeRelative y x == x) || equalFilePath (y &lt;/&gt; makeRelative y x) x
          makeRelative x x == &quot;.&quot;
          null y || equalFilePath (makeRelative x (x &lt;/&gt; y)) y || null (takeFileName x)
 Windows: makeRelative &quot;C:\\Home&quot; &quot;c:\\home\\bob&quot; == &quot;bob&quot;
 Windows: makeRelative &quot;C:\\Home&quot; &quot;c:/home/bob&quot; == &quot;bob&quot;
 Windows: makeRelative &quot;C:\\Home&quot; &quot;D:\\Home\\Bob&quot; == &quot;D:\\Home\\Bob&quot;
 Windows: makeRelative &quot;C:\\Home&quot; &quot;C:Home\\Bob&quot; == &quot;C:Home\\Bob&quot;
 Windows: makeRelative &quot;/Home&quot; &quot;/home/bob&quot; == &quot;bob&quot;
 Posix:   makeRelative &quot;/Home&quot; &quot;/home/bob&quot; == &quot;/home/bob&quot;
 Posix:   makeRelative &quot;/home/&quot; &quot;/home/bob/foo/bar&quot; == &quot;bob/foo/bar&quot;
 Posix:   makeRelative &quot;/fred&quot; &quot;bob&quot; == &quot;bob&quot;
 Posix:   makeRelative &quot;/file/test&quot; &quot;/file/test/fred&quot; == &quot;fred&quot;
 Posix:   makeRelative &quot;/file/test&quot; &quot;/file/test/fred/&quot; == &quot;fred/&quot;
 Posix:   makeRelative &quot;some/path&quot; &quot;some/path/a/b/c&quot; == &quot;a/b/c&quot;
</pre></div></div><div class="top"><p class="src"><a name="v:isRelative" class="def">isRelative</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Is a path relative, or is it fixed to the root?
</p><pre> Windows: isRelative &quot;path\\test&quot; == True
 Windows: isRelative &quot;c:\\test&quot; == False
 Windows: isRelative &quot;c:test&quot; == True
 Windows: isRelative &quot;c:&quot; == True
 Windows: isRelative &quot;\\\\foo&quot; == False
 Windows: isRelative &quot;/foo&quot; == True
 Posix:   isRelative &quot;test/path&quot; == True
 Posix:   isRelative &quot;/test&quot; == False
</pre></div></div><div class="top"><p class="src"><a name="v:isAbsolute" class="def">isAbsolute</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><pre>not . <code><a href="System-FilePath-Posix.html#v:isRelative">isRelative</a></code></pre><pre> isAbsolute x == not (isRelative x)
</pre></div></div><div class="top"><p class="src"><a name="v:isValid" class="def">isValid</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Is a FilePath valid, i.e. could you create a file like it?
</p><pre>          isValid &quot;&quot; == False
 Posix:   isValid &quot;/random_ path:*&quot; == True
 Posix:   isValid x == not (null x)
 Windows: isValid &quot;c:\\test&quot; == True
 Windows: isValid &quot;c:\\test:of_test&quot; == False
 Windows: isValid &quot;test*&quot; == False
 Windows: isValid &quot;c:\\test\\nul&quot; == False
 Windows: isValid &quot;c:\\test\\prn.txt&quot; == False
 Windows: isValid &quot;c:\\nul\\file&quot; == False
 Windows: isValid &quot;\\\\&quot; == False
</pre></div></div><div class="top"><p class="src"><a name="v:makeValid" class="def">makeValid</a> :: <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a> -&gt; <a href="System-FilePath-Posix.html#t:FilePath">FilePath</a></p><div class="doc"><p>Take a FilePath and make it valid; does not change already valid FilePaths.
</p><pre> isValid (makeValid x)
 isValid x ==&gt; makeValid x == x
 makeValid &quot;&quot; == &quot;_&quot;
 Windows: makeValid &quot;c:\\test:of_test&quot; == &quot;c:\\test_of_test&quot;
 Windows: makeValid &quot;test*&quot; == &quot;test_&quot;
 Windows: makeValid &quot;c:\\test\\nul&quot; == &quot;c:\\test\\nul_&quot;
 Windows: makeValid &quot;c:\\test\\prn.txt&quot; == &quot;c:\\test\\prn_.txt&quot;
 Windows: makeValid &quot;c:\\test/prn.txt&quot; == &quot;c:\\test/prn_.txt&quot;
 Windows: makeValid &quot;c:\\nul\\file&quot; == &quot;c:\\nul_\\file&quot;
</pre></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>