<!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>Distribution.Simple.Utils</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_Distribution-Simple-Utils.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">Cabal-1.14.0: A framework for packaging Haskell software</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Maintainer</th><td>cabal-devel@haskell.org</td></tr><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Distribution.Simple.Utils</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">logging and errors </a></li><li><a href="#g:2">running programs </a></li><li><a href="#g:3">copying files </a></li><li><a href="#g:4">installing files </a></li><li><a href="#g:5">File permissions </a></li><li><a href="#g:6">file names </a></li><li><a href="#g:7">finding files </a></li><li><a href="#g:8">simple file globbing </a></li><li><a href="#g:9">temp files and dirs </a></li><li><a href="#g:10">.cabal and .buildinfo files </a></li><li><a href="#g:11">reading and writing files safely </a></li><li><a href="#g:12">Unicode </a></li><li><a href="#g:13">generic utils </a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A large and somewhat miscellaneous collection of utility functions used throughout the rest of the Cabal lib and in other tools that use the Cabal lib like <code>cabal-install</code>. It has a very simple set of logging actions. It has low level functions for running programs, a bunch of wrappers for various directory and file functions that do extra logging. </p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:cabalVersion">cabalVersion</a> :: <a href="Distribution-Version.html#t:Version">Version</a></li><li class="src short"><a href="#v:die">die</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:dieWithLocation">dieWithLocation</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:topHandler">topHandler</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:warn">warn</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:notice">notice</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:setupMessage">setupMessage</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="Distribution-Package.html#t:PackageIdentifier">PackageIdentifier</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:info">info</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:debug">debug</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:chattyTry">chattyTry</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> () -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:rawSystemExit">rawSystemExit</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:rawSystemExitCode">rawSystemExitCode</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-Exit.html#t:ExitCode">ExitCode</a></li><li class="src short"><a href="#v:rawSystemExitWithEnv">rawSystemExitWithEnv</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [<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>, <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>)] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:rawSystemStdout">rawSystemStdout</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:rawSystemStdInOut">rawSystemStdInOut</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>, <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a>) -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<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>, <a href="../base-4.5.1.0/System-Exit.html#t:ExitCode">ExitCode</a>)</li><li class="src short"><a href="#v:maybeExit">maybeExit</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-Exit.html#t:ExitCode">ExitCode</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:xargs">xargs</a> :: <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a> -> ([<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()) -> [<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>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:findProgramLocation">findProgramLocation</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)</li><li class="src short"><a href="#v:findProgramVersion">findProgramVersion</a> :: <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> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>) -> <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Distribution-Version.html#t:Version">Version</a>)</li><li class="src short"><a href="#v:smartCopySources">smartCopySources</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [<a href="Distribution-ModuleName.html#t:ModuleName">ModuleName</a>] -> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:createDirectoryIfMissingVerbose">createDirectoryIfMissingVerbose</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:copyFileVerbose">copyFileVerbose</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:copyDirectoryRecursiveVerbose">copyDirectoryRecursiveVerbose</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:copyFiles">copyFiles</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [(<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>, <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:installOrdinaryFile">installOrdinaryFile</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:installExecutableFile">installExecutableFile</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:installOrdinaryFiles">installOrdinaryFiles</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [(<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>, <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:installDirectoryContents">installDirectoryContents</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:setFileOrdinary">setFileOrdinary</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:setFileExecutable">setFileExecutable</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:currentDir">currentDir</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:findFile">findFile</a> :: [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:findFirstFile">findFirstFile</a> :: (a -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>) -> [a] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a)</li><li class="src short"><a href="#v:findFileWithExtension">findFileWithExtension</a> :: [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)</li><li class="src short"><a href="#v:findFileWithExtension-39-">findFileWithExtension'</a> :: [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>, <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>))</li><li class="src short"><a href="#v:findModuleFile">findModuleFile</a> :: [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>] -> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="Distribution-ModuleName.html#t:ModuleName">ModuleName</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>, <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)</li><li class="src short"><a href="#v:findModuleFiles">findModuleFiles</a> :: [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>] -> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> [<a href="Distribution-ModuleName.html#t:ModuleName">ModuleName</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [(<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>, <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)]</li><li class="src short"><a href="#v:getDirectoryContentsRecursive">getDirectoryContentsRecursive</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>]</li><li class="src short"><a href="#v:matchFileGlob">matchFileGlob</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>]</li><li class="src short"><a href="#v:matchDirFileGlob">matchDirFileGlob</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>]</li><li class="src short"><a href="#v:parseFileGlob">parseFileGlob</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Distribution-Simple-Utils.html#t:FileGlob">FileGlob</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:FileGlob">FileGlob</a> <ul class="subs"><li>= <a href="#v:NoGlob">NoGlob</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> </li><li>| <a href="#v:FileGlob">FileGlob</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> </li></ul></li><li class="src short"><a href="#v:withTempFile">withTempFile</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> (<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/GHC-IO-Handle.html#t:Handle">Handle</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a) -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:withTempDirectory">withTempDirectory</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> (<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a) -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:defaultPackageDesc">defaultPackageDesc</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:findPackageDesc">findPackageDesc</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:defaultHookedPackageDesc">defaultHookedPackageDesc</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)</li><li class="src short"><a href="#v:findHookedPackageDesc">findHookedPackageDesc</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)</li><li class="src short"><a href="#v:withFileContents">withFileContents</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> (<a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a) -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:writeFileAtomic">writeFileAtomic</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:rewriteFile">rewriteFile</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:fromUTF8">fromUTF8</a> :: <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:toUTF8">toUTF8</a> :: <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:readUTF8File">readUTF8File</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:withUTF8FileContents">withUTF8FileContents</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> (<a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a) -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:writeUTF8File">writeUTF8File</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:normaliseLineEndings">normaliseLineEndings</a> :: <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:equating">equating</a> :: <a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> a => (b -> a) -> b -> b -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:comparing">comparing</a> :: <a href="../base-4.5.1.0/Data-Ord.html#t:Ord">Ord</a> a => (b -> a) -> b -> b -> <a href="../base-4.5.1.0/Data-Ord.html#t:Ordering">Ordering</a></li><li class="src short"><a href="#v:isInfixOf">isInfixOf</a> :: <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> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:intercalate">intercalate</a> :: [a] -> [[a]] -> [a]</li><li class="src short"><a href="#v:lowercase">lowercase</a> :: <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:wrapText">wrapText</a> :: <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:wrapLine">wrapLine</a> :: <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a> -> [<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></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:cabalVersion" class="def">cabalVersion</a> :: <a href="Distribution-Version.html#t:Version">Version</a></p></div><h1 id="g:1">logging and errors </h1><div class="top"><p class="src"><a name="v:die" class="def">die</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</p></div><div class="top"><p class="src"><a name="v:dieWithLocation" class="def">dieWithLocation</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</p></div><div class="top"><p class="src"><a name="v:topHandler" class="def">topHandler</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</p></div><div class="top"><p class="src"><a name="v:warn" class="def">warn</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>Non fatal conditions that may be indicative of an error or problem. </p><p>We display these at the <code><a href="Distribution-Verbosity.html#v:normal">normal</a></code> verbosity level. </p></div></div><div class="top"><p class="src"><a name="v:notice" class="def">notice</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>Useful status messages. </p><p>We display these at the <code><a href="Distribution-Verbosity.html#v:normal">normal</a></code> verbosity level. </p><p>This is for the ordinary helpful status messages that users see. Just enough information to know that things are working but not floods of detail. </p></div></div><div class="top"><p class="src"><a name="v:setupMessage" class="def">setupMessage</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="Distribution-Package.html#t:PackageIdentifier">PackageIdentifier</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p></div><div class="top"><p class="src"><a name="v:info" class="def">info</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>More detail on the operation of some action. </p><p>We display these messages when the verbosity level is <code><a href="Distribution-Verbosity.html#v:verbose">verbose</a></code> </p></div></div><div class="top"><p class="src"><a name="v:debug" class="def">debug</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>Detailed internal debugging information </p><p>We display these messages when the verbosity level is <code><a href="Distribution-Verbosity.html#v:deafening">deafening</a></code> </p></div></div><div class="top"><p class="src"><a name="v:chattyTry" class="def">chattyTry</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>a description of the action we were attempting </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</td><td class="doc"><p>the action itself </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Perform an IO action, catching any IO exceptions and printing an error if one occurs. </p></div></div><h1 id="g:2">running programs </h1><div class="top"><p class="src"><a name="v:rawSystemExit" class="def">rawSystemExit</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p></div><div class="top"><p class="src"><a name="v:rawSystemExitCode" class="def">rawSystemExitCode</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-Exit.html#t:ExitCode">ExitCode</a></p></div><div class="top"><p class="src"><a name="v:rawSystemExitWithEnv" class="def">rawSystemExitWithEnv</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [<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>, <a href="../base-4.5.1.0/Data-String.html#t:String">String</a>)] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p></div><div class="top"><p class="src"><a name="v:rawSystemStdout" class="def">rawSystemStdout</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></p><div class="doc"><p>Run a command and return its output. </p><p>The output is assumed to be text in the locale encoding. </p></div></div><div class="top"><p class="src"><a name="v:rawSystemStdInOut" class="def">rawSystemStdInOut</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>, <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a>)</td><td class="doc"><p>input text and binary mode </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></td><td class="doc"><p>output in binary mode </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<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>, <a href="../base-4.5.1.0/System-Exit.html#t:ExitCode">ExitCode</a>)</td><td class="doc"><p>output, errors, exit </p></td></tr></table></div><div class="doc"><p>Run a command and return its output, errors and exit status. Optionally also supply some input. Also provides control over whether the binary/text mode of the input and output. </p></div></div><div class="top"><p class="src"><a name="v:maybeExit" class="def">maybeExit</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-Exit.html#t:ExitCode">ExitCode</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p></div><div class="top"><p class="src"><a name="v:xargs" class="def">xargs</a> :: <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a> -> ([<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()) -> [<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>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>Like the unix xargs program. Useful for when we've got very long command lines that might overflow an OS limit on command line length and so you need to invoke a command multiple times to get all the args in. </p><p>Use it with either of the rawSystem variants above. For example: </p><pre> xargs (32*1024) (rawSystemExit verbosity) prog fixedArgs bigArgs </pre></div></div><div class="top"><p class="src"><a name="v:findProgramLocation" class="def">findProgramLocation</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)</p><div class="doc"><p>Look for a program on the path. </p></div></div><div class="top"><p class="src"><a name="v:findProgramVersion" class="def">findProgramVersion</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>version args </p></td></tr><tr><td class="src">-> (<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>)</td><td class="doc"><p>function to select version number from program output </p></td></tr><tr><td class="src">-> <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>location </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Distribution-Version.html#t:Version">Version</a>)</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Look for a program and try to find it's version number. It can accept either an absolute path or the name of a program binary, in which case we will look for the program on the path. </p></div></div><h1 id="g:3">copying files </h1><div class="top"><p class="src"><a name="v:smartCopySources" class="def">smartCopySources</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [<a href="Distribution-ModuleName.html#t:ModuleName">ModuleName</a>] -> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><div class="warning"><p>Deprecated: Use findModuleFiles and copyFiles or installOrdinaryFiles</p></div></div></div><div class="top"><p class="src"><a name="v:createDirectoryIfMissingVerbose" class="def">createDirectoryIfMissingVerbose</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></td><td class="doc"><p>Create its parents too? </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Same as <code>createDirectoryIfMissing</code> but logs at higher verbosity levels. </p></div></div><div class="top"><p class="src"><a name="v:copyFileVerbose" class="def">copyFileVerbose</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>Copies a file without copying file permissions. The target file is created with default permissions. Any existing target file is replaced. </p><p>At higher verbosity levels it logs an info message. </p></div></div><div class="top"><p class="src"><a name="v:copyDirectoryRecursiveVerbose" class="def">copyDirectoryRecursiveVerbose</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><div class="warning"><p>Deprecated: You probably want installDirectoryContents instead</p></div></div></div><div class="top"><p class="src"><a name="v:copyFiles" class="def">copyFiles</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [(<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>, <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>Copies a bunch of files to a target directory, preserving the directory structure in the target location. The target directories are created if they do not exist. </p><p>The files are identified by a pair of base directory and a path relative to that base. It is only the relative part that is preserved in the destination. </p><p>For example: </p><pre> copyFiles normal "dist/src" [("", "src/Foo.hs"), ("dist/build/", "src/Bar.hs")] </pre><p>This would copy "src/Foo.hs" to "dist/src/src/Foo.hs" and copy "dist/build/src/Bar.hs" to "dist/src/src/Bar.hs". </p><p>This operation is not atomic. Any IO failure during the copy (including any missing source files) leaves the target in an unknown state so it is best to use it with a freshly created directory so that it can be simply deleted if anything goes wrong. </p></div></div><h1 id="g:4">installing files </h1><div class="top"><p class="src"><a name="v:installOrdinaryFile" class="def">installOrdinaryFile</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>Install an ordinary file. This is like a file copy but the permissions are set appropriately for an installed file. On Unix it is "-rw-r--r--" while on Windows it uses the default permissions for the target directory. </p></div></div><div class="top"><p class="src"><a name="v:installExecutableFile" class="def">installExecutableFile</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>Install an executable file. This is like a file copy but the permissions are set appropriately for an installed file. On Unix it is "-rwxr-xr-x" while on Windows it uses the default permissions for the target directory. </p></div></div><div class="top"><p class="src"><a name="v:installOrdinaryFiles" class="def">installOrdinaryFiles</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> [(<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>, <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>This is like <code><a href="Distribution-Simple-Utils.html#v:copyFiles">copyFiles</a></code> but uses <code><a href="Distribution-Simple-Utils.html#v:installOrdinaryFile">installOrdinaryFile</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:installDirectoryContents" class="def">installDirectoryContents</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>This installs all the files in a directory to a target location, preserving the directory layout. All the files are assumed to be ordinary rather than executable files. </p></div></div><h1 id="g:5">File permissions </h1><div class="top"><p class="src"><a name="v:setFileOrdinary" class="def">setFileOrdinary</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p></div><div class="top"><p class="src"><a name="v:setFileExecutable" class="def">setFileExecutable</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p></div><h1 id="g:6">file names </h1><div class="top"><p class="src"><a name="v:currentDir" class="def">currentDir</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></p><div class="doc"><p>The path name that represents the current directory. In Unix, it's <code>"."</code>, but this is system-specific. (E.g. AmigaOS uses the empty string <code>""</code> for the current directory.) </p></div></div><h1 id="g:7">finding files </h1><div class="top"><p class="src"><a name="v:findFile" class="def">findFile</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>]</td><td class="doc"><p>search locations </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>File Name </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Find a file by looking in a search path. The file path must match exactly. </p></div></div><div class="top"><p class="src"><a name="v:findFirstFile" class="def">findFirstFile</a> :: (a -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>) -> [a] -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a)</p></div><div class="top"><p class="src"><a name="v:findFileWithExtension" class="def">findFileWithExtension</a> :: [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)</p><div class="doc"><p>Find a file by looking in a search path with one of a list of possible file extensions. The file base name should be given and it will be tried with each of the extensions in each element of the search path. </p></div></div><div class="top"><p class="src"><a name="v:findFileWithExtension-39-" class="def">findFileWithExtension'</a> :: [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>] -> [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>] -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>, <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>))</p><div class="doc"><p>Like <code><a href="Distribution-Simple-Utils.html#v:findFileWithExtension">findFileWithExtension</a></code> but returns which element of the search path the file was found in, and the file path relative to that base directory. </p></div></div><div class="top"><p class="src"><a name="v:findModuleFile" class="def">findModuleFile</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>]</td><td class="doc"><p>build prefix (location of objects) </p></td></tr><tr><td class="src">-> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</td><td class="doc"><p>search suffixes </p></td></tr><tr><td class="src">-> <a href="Distribution-ModuleName.html#t:ModuleName">ModuleName</a></td><td class="doc"><p>module </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>, <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Find the file corresponding to a Haskell module name. </p><p>This is similar to <code><a href="Distribution-Simple-Utils.html#v:findFileWithExtension-39-">findFileWithExtension'</a></code> but specialised to a module name. The function fails if the file corresponding to the module is missing. </p></div></div><div class="top"><p class="src"><a name="v:findModuleFiles" class="def">findModuleFiles</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>]</td><td class="doc"><p>build prefix (location of objects) </p></td></tr><tr><td class="src">-> [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</td><td class="doc"><p>search suffixes </p></td></tr><tr><td class="src">-> [<a href="Distribution-ModuleName.html#t:ModuleName">ModuleName</a>]</td><td class="doc"><p>modules </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [(<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>, <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)]</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Finds the files corresponding to a list of Haskell module names. </p><p>As <code><a href="Distribution-Simple-Utils.html#v:findModuleFile">findModuleFile</a></code> but for a list of module names. </p></div></div><div class="top"><p class="src"><a name="v:getDirectoryContentsRecursive" class="def">getDirectoryContentsRecursive</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>]</p><div class="doc"><p>List all the files in a directory and all subdirectories. </p><p>The order places files in sub-directories after all the files in their parent directories. The list is generated lazily so is not well defined if the source directory structure changes before the list is used. </p></div></div><h1 id="g:8">simple file globbing </h1><div class="top"><p class="src"><a name="v:matchFileGlob" class="def">matchFileGlob</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>]</p></div><div class="top"><p class="src"><a name="v:matchDirFileGlob" class="def">matchDirFileGlob</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>]</p></div><div class="top"><p class="src"><a name="v:parseFileGlob" class="def">parseFileGlob</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Distribution-Simple-Utils.html#t:FileGlob">FileGlob</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:FileGlob" class="def">FileGlob</a> </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:NoGlob" class="def">NoGlob</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>No glob at all, just an ordinary file </p></td></tr><tr><td class="src"><a name="v:FileGlob" class="def">FileGlob</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>dir prefix and extension, like <code>"foo/bar/*.baz"</code> corresponds to <code>FileGlob "foo/bar" ".baz"</code> </p></td></tr></table></div></div><h1 id="g:9">temp files and dirs </h1><div class="top"><p class="src"><a name="v:withTempFile" class="def">withTempFile</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>Temp dir to create the file in </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></td><td class="doc"><p>File name template. See <code><a href="../base-4.5.1.0/System-IO.html#v:openTempFile">openTempFile</a></code>. </p></td></tr><tr><td class="src">-> (<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/GHC-IO-Handle.html#t:Handle">Handle</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Use a temporary filename that doesn't already exist. </p></div></div><div class="top"><p class="src"><a name="v:withTempDirectory" class="def">withTempDirectory</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> (<a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a) -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</p><div class="doc"><p>Create and use a temporary directory. </p><p>Creates a new temporary directory inside the given directory, making use of the template. The temp directory is deleted after use. For example: </p><pre> withTempDirectory verbosity "src" "sdist." $ \tmpDir -> do ... </pre><p>The <code>tmpDir</code> will be a new subdirectory of the given directory, e.g. <code>src/sdist.342</code>. </p></div></div><h1 id="g:10">.cabal and .buildinfo files </h1><div class="top"><p class="src"><a name="v:defaultPackageDesc" class="def">defaultPackageDesc</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></p><div class="doc"><p>Package description file (<em>pkgname</em><code>.cabal</code>) </p></div></div><div class="top"><p class="src"><a name="v:findPackageDesc" class="def">findPackageDesc</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>Where to look </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p><a href="pkgname">pkgname</a>.cabal </p></td></tr></table></div><div class="doc"><p>Find a package description file in the given directory. Looks for <code>.cabal</code> files. </p></div></div><div class="top"><p class="src"><a name="v:defaultHookedPackageDesc" class="def">defaultHookedPackageDesc</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)</p><div class="doc"><p>Optional auxiliary package information file (<em>pkgname</em><code>.buildinfo</code>) </p></div></div><div class="top"><p class="src"><a name="v:findHookedPackageDesc" class="def">findHookedPackageDesc</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>Directory to search </p></td></tr><tr><td class="src">-> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)</td><td class="doc"><p><em>dir</em><code>/</code><em>pkgname</em><code>.buildinfo</code>, if present </p></td></tr></table></div><div class="doc"><p>Find auxiliary package information in the given directory. Looks for <code>.buildinfo</code> files. </p></div></div><h1 id="g:11">reading and writing files safely </h1><div class="top"><p class="src"><a name="v:withFileContents" class="def">withFileContents</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> (<a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a) -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</p><div class="doc"><p>Gets the contents of a file, but guarantee that it gets closed. </p><p>The file is read lazily but if it is not fully consumed by the action then the remaining input is truncated and the file is closed. </p></div></div><div class="top"><p class="src"><a name="v:writeFileAtomic" class="def">writeFileAtomic</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>Writes a file atomically. </p><p>The file is either written sucessfully or an IO exception is raised and the original file is left unchanged. </p><p>On windows it is not possible to delete a file that is open by a process. This case will give an IO exception but the atomic property is not affected. </p></div></div><div class="top"><p class="src"><a name="v:rewriteFile" class="def">rewriteFile</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>Write a file but only if it would have new content. If we would be writing the same as the existing content then leave the file as is so that we do not update the file's modification time. </p></div></div><h1 id="g:12">Unicode </h1><div class="top"><p class="src"><a name="v:fromUTF8" class="def">fromUTF8</a> :: <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><div class="top"><p class="src"><a name="v:toUTF8" class="def">toUTF8</a> :: <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><div class="top"><p class="src"><a name="v:readUTF8File" class="def">readUTF8File</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></p><div class="doc"><p>Reads a UTF8 encoded text file as a Unicode String </p><p>Reads lazily using ordinary <code><a href="../base-4.5.1.0/System-IO.html#v:readFile">readFile</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:withUTF8FileContents" class="def">withUTF8FileContents</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> (<a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a) -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> a</p><div class="doc"><p>Reads a UTF8 encoded text file as a Unicode String </p><p>Same behaviour as <code><a href="Distribution-Simple-Utils.html#v:withFileContents">withFileContents</a></code>. </p></div></div><div class="top"><p class="src"><a name="v:writeUTF8File" class="def">writeUTF8File</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p>Writes a Unicode String as a UTF8 encoded text file. </p><p>Uses <code><a href="Distribution-Simple-Utils.html#v:writeFileAtomic">writeFileAtomic</a></code>, so provides the same guarantees. </p></div></div><div class="top"><p class="src"><a name="v:normaliseLineEndings" class="def">normaliseLineEndings</a> :: <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>Fix different systems silly line ending conventions </p></div></div><h1 id="g:13">generic utils </h1><div class="top"><p class="src"><a name="v:equating" class="def">equating</a> :: <a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> a => (b -> a) -> b -> b -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:comparing" class="def">comparing</a> :: <a href="../base-4.5.1.0/Data-Ord.html#t:Ord">Ord</a> a => (b -> a) -> b -> b -> <a href="../base-4.5.1.0/Data-Ord.html#t:Ordering">Ordering</a></p></div><div class="top"><p class="src"><a name="v:isInfixOf" class="def">isInfixOf</a> :: <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> -> <a href="../base-4.5.1.0/Data-Bool.html#t:Bool">Bool</a></p></div><div class="top"><p class="src"><a name="v:intercalate" class="def">intercalate</a> :: [a] -> [[a]] -> [a]</p></div><div class="top"><p class="src"><a name="v:lowercase" class="def">lowercase</a> :: <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><div class="top"><p class="src"><a name="v:wrapText" class="def">wrapText</a> :: <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>Wraps text to the default line width. Existing newlines are preserved. </p></div></div><div class="top"><p class="src"><a name="v:wrapLine" class="def">wrapLine</a> :: <a href="../base-4.5.1.0/Data-Int.html#t:Int">Int</a> -> [<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>Wraps a list of words to a list of lines of words of a particular width. </p></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>