Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 1f2b142b9d2ef4849a6f5316fa1c5b12 > files > 1744

ghc-6.10.4-1mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--Rendered using the Haskell Html Library v0.2-->
<HTML
><HEAD
><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
><TITLE
>System.FilePath.Windows</TITLE
><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
><SCRIPT SRC="haddock-util.js" TYPE="text/javascript"
></SCRIPT
><SCRIPT TYPE="text/javascript"
>window.onload = function () {setSynopsis("mini_System-FilePath-Windows.html")};</SCRIPT
></HEAD
><BODY
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="topbar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" "
></TD
><TD CLASS="title"
>filepath-1.1.0.2: Library for manipulating FilePath's in a cross platform way.</TD
><TD CLASS="topbut"
><A HREF="index.html"
>Contents</A
></TD
><TD CLASS="topbut"
><A HREF="doc-index.html"
>Index</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="modulebar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><FONT SIZE="6"
>System.FilePath.Windows</FONT
></TD
><TD ALIGN="right"
><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="infohead"
>Portability</TD
><TD CLASS="infoval"
>portable</TD
></TR
><TR
><TD CLASS="infohead"
>Stability</TD
><TD CLASS="infoval"
>stable</TD
></TR
><TR
><TD CLASS="infohead"
>Maintainer</TD
><TD CLASS="infoval"
>libraries@haskell.org</TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="section4"
><B
>Contents</B
></TD
></TR
><TR
><TD
><DL
><DT
><A HREF="#1"
>Separator predicates
</A
></DT
><DT
><A HREF="#2"
>Path methods (environment $PATH)
</A
></DT
><DT
><A HREF="#3"
>Extension methods
</A
></DT
><DT
><A HREF="#4"
>Drive methods
</A
></DT
><DT
><A HREF="#5"
>Operations on a FilePath, as a list of directories
</A
></DT
><DT
><A HREF="#6"
>Low level FilePath operators
</A
></DT
><DT
><A HREF="#7"
>File name manipulators
</A
></DT
></DL
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Description</TD
></TR
><TR
><TD CLASS="doc"
>A library for FilePath manipulations, using Windows style paths on
 all platforms. Importing <A HREF="System-FilePath.html"
>System.FilePath</A
> is usually better.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Synopsis</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3ApathSeparator"
>pathSeparator</A
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3ApathSeparators"
>pathSeparators</A
> :: [<A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
>]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisPathSeparator"
>isPathSeparator</A
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AsearchPathSeparator"
>searchPathSeparator</A
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisSearchPathSeparator"
>isSearchPathSeparator</A
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AextSeparator"
>extSeparator</A
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisExtSeparator"
>isExtSeparator</A
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AsplitSearchPath"
>splitSearchPath</A
> :: <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; [<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AgetSearchPath"
>getSearchPath</A
> :: <A HREF="../base/System-IO.html#t%3AIO"
>IO</A
> [<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AsplitExtension"
>splitExtension</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; (<A HREF="../base/Data-Char.html#t%3AString"
>String</A
>, <A HREF="../base/Data-Char.html#t%3AString"
>String</A
>)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AtakeExtension"
>takeExtension</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AreplaceExtension"
>replaceExtension</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AdropExtension"
>dropExtension</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AaddExtension"
>addExtension</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AhasExtension"
>hasExtension</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3A%3C.%3E"
>(&lt;.&gt;)</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AsplitExtensions"
>splitExtensions</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; (<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>, <A HREF="../base/Data-Char.html#t%3AString"
>String</A
>)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AdropExtensions"
>dropExtensions</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AtakeExtensions"
>takeExtensions</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AsplitDrive"
>splitDrive</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; (<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>, <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AjoinDrive"
>joinDrive</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AtakeDrive"
>takeDrive</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AhasDrive"
>hasDrive</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AdropDrive"
>dropDrive</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisDrive"
>isDrive</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AsplitFileName"
>splitFileName</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; (<A HREF="../base/Data-Char.html#t%3AString"
>String</A
>, <A HREF="../base/Data-Char.html#t%3AString"
>String</A
>)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AtakeFileName"
>takeFileName</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AreplaceFileName"
>replaceFileName</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AdropFileName"
>dropFileName</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AtakeBaseName"
>takeBaseName</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AreplaceBaseName"
>replaceBaseName</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AtakeDirectory"
>takeDirectory</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AreplaceDirectory"
>replaceDirectory</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Acombine"
>combine</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3A%3C%2F%3E"
>(&lt;/&gt;)</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AsplitPath"
>splitPath</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; [<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AjoinPath"
>joinPath</A
> :: [<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>] -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AsplitDirectories"
>splitDirectories</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; [<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>]</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AhasTrailingPathSeparator"
>hasTrailingPathSeparator</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AaddTrailingPathSeparator"
>addTrailingPathSeparator</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AdropTrailingPathSeparator"
>dropTrailingPathSeparator</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Anormalise"
>normalise</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AequalFilePath"
>equalFilePath</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmakeRelative"
>makeRelative</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisRelative"
>isRelative</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisAbsolute"
>isAbsolute</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AisValid"
>isValid</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmakeValid"
>makeValid</A
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="1"
><A NAME="1"
>Separator predicates
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:pathSeparator"
><A NAME="v%3ApathSeparator"
></A
></A
><B
>pathSeparator</B
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The character that separates directories. In the case where more than
   one character is possible, <TT
><A HREF="System-FilePath-Windows.html#v%3ApathSeparator"
>pathSeparator</A
></TT
> is the 'ideal' one.
</P
><PRE
> Windows: pathSeparator == '\\'
 Posix:   pathSeparator ==  '/'
 isPathSeparator pathSeparator
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:pathSeparators"
><A NAME="v%3ApathSeparators"
></A
></A
><B
>pathSeparators</B
> :: [<A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
>]</TD
></TR
><TR
><TD CLASS="doc"
><P
>The list of all possible separators.
</P
><PRE
> Windows: pathSeparators == ['\\', '/']
 Posix:   pathSeparators == ['/']
 pathSeparator `elem` pathSeparators
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isPathSeparator"
><A NAME="v%3AisPathSeparator"
></A
></A
><B
>isPathSeparator</B
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Rather than using <TT
>(== <TT
><A HREF="System-FilePath-Windows.html#v%3ApathSeparator"
>pathSeparator</A
></TT
>)</TT
>, use this. Test if something
   is a path separator.
</P
><PRE
> isPathSeparator a == (a `elem` pathSeparators)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:searchPathSeparator"
><A NAME="v%3AsearchPathSeparator"
></A
></A
><B
>searchPathSeparator</B
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>The character that is used to separate the entries in the $PATH environment variable.
</P
><PRE
> Windows: searchPathSeparator == ';'
 Posix:   searchPathSeparator == ':'
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isSearchPathSeparator"
><A NAME="v%3AisSearchPathSeparator"
></A
></A
><B
>isSearchPathSeparator</B
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Is the character a file separator?
</P
><PRE
> isSearchPathSeparator a == (a == searchPathSeparator)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:extSeparator"
><A NAME="v%3AextSeparator"
></A
></A
><B
>extSeparator</B
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>File extension character
</P
><PRE
> extSeparator == '.'
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isExtSeparator"
><A NAME="v%3AisExtSeparator"
></A
></A
><B
>isExtSeparator</B
> :: <A HREF="../ghc-prim/GHC-Types.html#t%3AChar"
>Char</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Is the character an extension character?
</P
><PRE
> isExtSeparator a == (a == extSeparator)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="2"
><A NAME="2"
>Path methods (environment $PATH)
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:splitSearchPath"
><A NAME="v%3AsplitSearchPath"
></A
></A
><B
>splitSearchPath</B
> :: <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; [<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>]</TD
></TR
><TR
><TD CLASS="doc"
><P
>Take a string, split it on the <TT
><A HREF="System-FilePath-Windows.html#v%3AsearchPathSeparator"
>searchPathSeparator</A
></TT
> 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:getSearchPath"
><A NAME="v%3AgetSearchPath"
></A
></A
><B
>getSearchPath</B
> :: <A HREF="../base/System-IO.html#t%3AIO"
>IO</A
> [<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>]</TD
></TR
><TR
><TD CLASS="doc"
>Get a list of filepaths in the $PATH.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="3"
><A NAME="3"
>Extension methods
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:splitExtension"
><A NAME="v%3AsplitExtension"
></A
></A
><B
>splitExtension</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; (<A HREF="../base/Data-Char.html#t%3AString"
>String</A
>, <A HREF="../base/Data-Char.html#t%3AString"
>String</A
>)</TD
></TR
><TR
><TD CLASS="doc"
><P
>Split on the extension. <TT
><A HREF="System-FilePath-Windows.html#v%3AaddExtension"
>addExtension</A
></TT
> 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:takeExtension"
><A NAME="v%3AtakeExtension"
></A
></A
><B
>takeExtension</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Get the extension of a file, returns <TT
>&quot;&quot;</TT
> for no extension, <TT
>.ext</TT
> 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:replaceExtension"
><A NAME="v%3AreplaceExtension"
></A
></A
><B
>replaceExtension</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:dropExtension"
><A NAME="v%3AdropExtension"
></A
></A
><B
>dropExtension</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Remove last extension, and the &quot;.&quot; preceding it.
</P
><PRE
> dropExtension x == fst (splitExtension x)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:addExtension"
><A NAME="v%3AaddExtension"
></A
></A
><B
>addExtension</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Add an extension, even if there is already one there.
   E.g. <TT
>addExtension &quot;foo.txt&quot; &quot;bat&quot; -&gt; &quot;foo.txt.bat&quot;</TT
>.
</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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:hasExtension"
><A NAME="v%3AhasExtension"
></A
></A
><B
>hasExtension</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Does the given filename have an extension?
</P
><PRE
> null (takeExtension x) == not (hasExtension x)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:<.>"
><A NAME="v%3A%3C.%3E"
></A
></A
><B
>(&lt;.&gt;)</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
>Alias to <TT
><A HREF="System-FilePath-Windows.html#v%3AaddExtension"
>addExtension</A
></TT
>, for people who like that sort of thing.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:splitExtensions"
><A NAME="v%3AsplitExtensions"
></A
></A
><B
>splitExtensions</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; (<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>, <A HREF="../base/Data-Char.html#t%3AString"
>String</A
>)</TD
></TR
><TR
><TD CLASS="doc"
><P
>Split on all extensions
</P
><PRE
> splitExtensions &quot;file.tar.gz&quot; == (&quot;file&quot;,&quot;.tar.gz&quot;)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:dropExtensions"
><A NAME="v%3AdropExtensions"
></A
></A
><B
>dropExtensions</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Drop all extensions
</P
><PRE
> not $ hasExtension (dropExtensions x)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:takeExtensions"
><A NAME="v%3AtakeExtensions"
></A
></A
><B
>takeExtensions</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Get all extensions
</P
><PRE
> takeExtensions &quot;file.tar.gz&quot; == &quot;.tar.gz&quot;
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="4"
><A NAME="4"
>Drive methods
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:splitDrive"
><A NAME="v%3AsplitDrive"
></A
></A
><B
>splitDrive</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; (<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>, <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>)</TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:joinDrive"
><A NAME="v%3AjoinDrive"
></A
></A
><B
>joinDrive</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:takeDrive"
><A NAME="v%3AtakeDrive"
></A
></A
><B
>takeDrive</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Get the drive from a filepath.
</P
><PRE
> takeDrive x == fst (splitDrive x)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:hasDrive"
><A NAME="v%3AhasDrive"
></A
></A
><B
>hasDrive</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Does a path have a drive.
</P
><PRE
> not (hasDrive x) == null (takeDrive x)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:dropDrive"
><A NAME="v%3AdropDrive"
></A
></A
><B
>dropDrive</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Delete the drive, if it exists.
</P
><PRE
> dropDrive x == snd (splitDrive x)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isDrive"
><A NAME="v%3AisDrive"
></A
></A
><B
>isDrive</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
>Is an element a drive
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="5"
><A NAME="5"
>Operations on a FilePath, as a list of directories
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:splitFileName"
><A NAME="v%3AsplitFileName"
></A
></A
><B
>splitFileName</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; (<A HREF="../base/Data-Char.html#t%3AString"
>String</A
>, <A HREF="../base/Data-Char.html#t%3AString"
>String</A
>)</TD
></TR
><TR
><TD CLASS="doc"
><P
>Split a filename into directory and file. <TT
><A HREF="System-FilePath-Windows.html#v%3Acombine"
>combine</A
></TT
> is the inverse.
</P
><PRE
> uncurry (++) (splitFileName x) == x
 Valid x =&gt; uncurry combine (splitFileName x) == 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:takeFileName"
><A NAME="v%3AtakeFileName"
></A
></A
><B
>takeFileName</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:replaceFileName"
><A NAME="v%3AreplaceFileName"
></A
></A
><B
>replaceFileName</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Set the filename.
</P
><PRE
> Valid x =&gt; replaceFileName x (takeFileName x) == x
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:dropFileName"
><A NAME="v%3AdropFileName"
></A
></A
><B
>dropFileName</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Drop the filename.
</P
><PRE
> dropFileName x == fst (splitFileName x)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:takeBaseName"
><A NAME="v%3AtakeBaseName"
></A
></A
><B
>takeBaseName</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
></TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:replaceBaseName"
><A NAME="v%3AreplaceBaseName"
></A
></A
><B
>replaceBaseName</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD 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;
 replaceBaseName x (takeBaseName x) == x
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:takeDirectory"
><A NAME="v%3AtakeDirectory"
></A
></A
><B
>takeDirectory</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Get the directory name, move up one level.
</P
><PRE
>           takeDirectory x `isPrefixOf` x
           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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:replaceDirectory"
><A NAME="v%3AreplaceDirectory"
></A
></A
><B
>replaceDirectory</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Set the directory, keeping the filename the same.
</P
><PRE
> replaceDirectory x (takeDirectory x) `equalFilePath` x
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:combine"
><A NAME="v%3Acombine"
></A
></A
><B
>combine</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Combine two paths, if the second path <TT
><A HREF="System-FilePath-Windows.html#v%3AisAbsolute"
>isAbsolute</A
></TT
>, 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:</>"
><A NAME="v%3A%3C%2F%3E"
></A
></A
><B
>(&lt;/&gt;)</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
>A nice alias for <TT
><A HREF="System-FilePath-Windows.html#v%3Acombine"
>combine</A
></TT
>.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:splitPath"
><A NAME="v%3AsplitPath"
></A
></A
><B
>splitPath</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; [<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>]</TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:joinPath"
><A NAME="v%3AjoinPath"
></A
></A
><B
>joinPath</B
> :: [<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>] -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:splitDirectories"
><A NAME="v%3AsplitDirectories"
></A
></A
><B
>splitDirectories</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; [<A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
>]</TD
></TR
><TR
><TD CLASS="doc"
><P
>Just as <TT
><A HREF="System-FilePath-Windows.html#v%3AsplitPath"
>splitPath</A
></TT
>, 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="6"
><A NAME="6"
>Low level FilePath operators
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:hasTrailingPathSeparator"
><A NAME="v%3AhasTrailingPathSeparator"
></A
></A
><B
>hasTrailingPathSeparator</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:addTrailingPathSeparator"
><A NAME="v%3AaddTrailingPathSeparator"
></A
></A
><B
>addTrailingPathSeparator</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:dropTrailingPathSeparator"
><A NAME="v%3AdropTrailingPathSeparator"
></A
></A
><B
>dropTrailingPathSeparator</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Remove any trailing path separators
</P
><PRE
> dropTrailingPathSeparator &quot;file/test/&quot; == &quot;file/test&quot;
 not (hasTrailingPathSeparator (dropTrailingPathSeparator x)) || isDrive x
 Posix:    dropTrailingPathSeparator &quot;/&quot; == &quot;/&quot;
 Windows:  dropTrailingPathSeparator &quot;\\&quot; == &quot;\\&quot;
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="7"
><A NAME="7"
>File name manipulators
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:normalise"
><A NAME="v%3Anormalise"
></A
></A
><B
>normalise</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Normalise a file
</P
><UL
><LI
> // outside of the drive can be made blank
</LI
><LI
> / -&gt; <TT
><A HREF="System-FilePath-Windows.html#v%3ApathSeparator"
>pathSeparator</A
></TT
>
</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;
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:equalFilePath"
><A NAME="v%3AequalFilePath"
></A
></A
><B
>equalFilePath</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Equality of two <TT
><A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TT
>s.
   If you call <TT
>System.Directory.canonicalizePath</TT
>
   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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:makeRelative"
><A NAME="v%3AmakeRelative"
></A
></A
><B
>makeRelative</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Contract a filename, based on a relative path.
</P
><P
>There is no corresponding <TT
>makeAbsolute</TT
> function, instead use
   <TT
>System.Directory.canonicalizePath</TT
> 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isRelative"
><A NAME="v%3AisRelative"
></A
></A
><B
>isRelative</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isAbsolute"
><A NAME="v%3AisAbsolute"
></A
></A
><B
>isAbsolute</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="doc"
><PRE
>not . <TT
><A HREF="System-FilePath-Windows.html#v%3AisRelative"
>isRelative</A
></TT
></PRE
><PRE
> isAbsolute x == not (isRelative x)
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:isValid"
><A NAME="v%3AisValid"
></A
></A
><B
>isValid</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
><A NAME="v:makeValid"
><A NAME="v%3AmakeValid"
></A
></A
><B
>makeValid</B
> :: <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
> -&gt; <A HREF="../base/System-IO.html#t%3AFilePath"
>FilePath</A
></TD
></TR
><TR
><TD 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
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="botbar"
>Produced by <A HREF="http://www.haskell.org/haddock/"
>Haddock</A
> version 2.4.2</TD
></TR
></TABLE
></BODY
></HTML
>