<!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.Directory</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-Directory.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" >directory-1.0.0.3: library for directory handling</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.Directory</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" >Actions on directories </A ></DT ><DT ><A HREF="#2" >Pre-defined directories </A ></DT ><DT ><A HREF="#3" >Actions on files </A ></DT ><DT ><A HREF="#4" >Existence tests </A ></DT ><DT ><A HREF="#5" >Permissions </A ></DT ><DT ><A HREF="#6" >Timestamps </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" >System-independent interface to directory manipulation. </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="#v%3AcreateDirectory" >createDirectory</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AcreateDirectoryIfMissing" >createDirectoryIfMissing</A > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A > -> <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AremoveDirectory" >removeDirectory</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AremoveDirectoryRecursive" >removeDirectoryRecursive</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3ArenameDirectory" >renameDirectory</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetDirectoryContents" >getDirectoryContents</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</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%3AgetCurrentDirectory" >getCurrentDirectory</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%3AsetCurrentDirectory" >setCurrentDirectory</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetHomeDirectory" >getHomeDirectory</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%3AgetAppUserDataDirectory" >getAppUserDataDirectory</A > :: <A HREF="../base/Data-Char.html#t%3AString" >String</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%3AgetUserDocumentsDirectory" >getUserDocumentsDirectory</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%3AgetTemporaryDirectory" >getTemporaryDirectory</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%3AremoveFile" >removeFile</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3ArenameFile" >renameFile</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AcopyFile" >copyFile</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AcanonicalizePath" >canonicalizePath</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</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%3AmakeRelativeToCurrentDirectory" >makeRelativeToCurrentDirectory</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</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%3AfindExecutable" >findExecutable</A > :: <A HREF="../base/Data-Char.html#t%3AString" >String</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > (<A HREF="../base/Data-Maybe.html#t%3AMaybe" >Maybe</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%3AdoesFileExist" >doesFileExist</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <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%3AdoesDirectoryExist" >doesDirectoryExist</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A HREF="#t%3APermissions" >Permissions</A > = <A HREF="#v%3APermissions" >Permissions</A > {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="recfield" ><A HREF="#v%3Areadable" >readable</A > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3Awritable" >writable</A > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3Aexecutable" >executable</A > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3Asearchable" >searchable</A > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ></TR ></TABLE >}</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetPermissions" >getPermissions</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="System-Directory.html#t%3APermissions" >Permissions</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AsetPermissions" >setPermissions</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="System-Directory.html#t%3APermissions" >Permissions</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetModificationTime" >getModificationTime</A > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../old-time/System-Time.html#t%3AClockTime" >ClockTime</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Documentation</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="doc" ><P >A directory contains a series of entries, each of which is a named reference to a file system object (file, directory etc.). Some entries may be hidden, inaccessible, or have some administrative function (e.g. <TT ><A HREF="../base/Prelude.html#v%3A." >.</A ></TT > or `..' under POSIX <A HREF="http://www.opengroup.org/onlinepubs/009695399/" >http://www.opengroup.org/onlinepubs/009695399/</A >), but in this standard all such entries are considered to form part of the directory contents. Entries in sub-directories are not, however, considered to form part of the directory contents. </P ><P >Each file system object is referenced by a <EM >path</EM >. There is normally at least one absolute path to each file system object. In some operating systems, it may also be possible to have paths which are relative to the current directory. </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="1" ><A NAME="1" >Actions on directories </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:createDirectory" ><A NAME="v%3AcreateDirectory" ></A ></A ><B >createDirectory</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="doc" ><P ><TT ><TT ><A HREF="System-Directory.html#v%3AcreateDirectory" >createDirectory</A ></TT > dir</TT > creates a new directory <TT >dir</TT > which is initially empty, or as near to empty as the operating system allows. </P ><P >The operation may fail with: </P ><UL ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisPermissionError" >isPermissionError</A ></TT > / <TT >PermissionDenied</TT > The process has insufficient privileges to perform the operation. <TT >[EROFS, EACCES]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisAlreadyExistsError" >isAlreadyExistsError</A ></TT > / <TT >AlreadyExists</TT > The operand refers to a directory that already exists. <TT > [EEXIST]</TT > </LI ><LI > <TT >HardwareFault</TT > A physical I/O error has occurred. <TT >[EIO]</TT > </LI ><LI > <TT >InvalidArgument</TT > The operand is not a valid directory name. <TT >[ENAMETOOLONG, ELOOP]</TT > </LI ><LI > <TT >NoSuchThing</TT > There is no path to the directory. <TT >[ENOENT, ENOTDIR]</TT > </LI ><LI > <TT >ResourceExhausted</TT > Insufficient resources (virtual memory, process file descriptors, physical disk space, etc.) are available to perform the operation. <TT >[EDQUOT, ENOSPC, ENOMEM, EMLINK]</TT > </LI ><LI > <TT >InappropriateType</TT > The path refers to an existing non-directory object. <TT >[EEXIST]</TT > </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:createDirectoryIfMissing" ><A NAME="v%3AcreateDirectoryIfMissing" ></A ></A ><B >createDirectoryIfMissing</B ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="arg" >:: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ><TD CLASS="rdoc" >Create its parents too? </TD ></TR ><TR ><TD CLASS="arg" >-> <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A ></TD ><TD CLASS="rdoc" >The path to the directory you want to make </TD ></TR ><TR ><TD CLASS="arg" >-> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="ndoc" COLSPAN="2" ><TT ><TT ><A HREF="System-Directory.html#v%3AcreateDirectoryIfMissing" >createDirectoryIfMissing</A ></TT > parents dir</TT > creates a new directory <TT >dir</TT > if it doesn't exist. If the first argument is <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3ATrue" >True</A ></TT > the function will also create all parent directories if they are missing. </TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:removeDirectory" ><A NAME="v%3AremoveDirectory" ></A ></A ><B >removeDirectory</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="doc" ><P ><TT ><TT ><A HREF="System-Directory.html#v%3AremoveDirectory" >removeDirectory</A ></TT > dir</TT > removes an existing directory <EM >dir</EM >. The implementation may specify additional constraints which must be satisfied before a directory can be removed (e.g. the directory has to be empty, or may not be in use by other processes). It is not legal for an implementation to partially remove a directory unless the entire directory is removed. A conformant implementation need not support directory removal in all situations (e.g. removal of the root directory). </P ><P >The operation may fail with: </P ><UL ><LI > <TT >HardwareFault</TT > A physical I/O error has occurred. EIO </LI ><LI > <TT >InvalidArgument</TT > The operand is not a valid directory name. [ENAMETOOLONG, ELOOP] </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > / <TT >NoSuchThing</TT > The directory does not exist. <TT >[ENOENT, ENOTDIR]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisPermissionError" >isPermissionError</A ></TT > / <TT >PermissionDenied</TT > The process has insufficient privileges to perform the operation. <TT >[EROFS, EACCES, EPERM]</TT > </LI ><LI > <TT >UnsatisfiedConstraints</TT > Implementation-dependent constraints are not satisfied. <TT >[EBUSY, ENOTEMPTY, EEXIST]</TT > </LI ><LI > <TT >UnsupportedOperation</TT > The implementation does not support removal in this situation. <TT >[EINVAL]</TT > </LI ><LI > <TT >InappropriateType</TT > The operand refers to an existing non-directory object. <TT >[ENOTDIR]</TT > </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:removeDirectoryRecursive" ><A NAME="v%3AremoveDirectoryRecursive" ></A ></A ><B >removeDirectoryRecursive</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="doc" ><TT ><TT ><A HREF="System-Directory.html#v%3AremoveDirectoryRecursive" >removeDirectoryRecursive</A ></TT > dir</TT > removes an existing directory <EM >dir</EM > together with its content and all subdirectories. Be careful, if the directory contains symlinks, the function will follow them. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:renameDirectory" ><A NAME="v%3ArenameDirectory" ></A ></A ><B >renameDirectory</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="doc" ><P ><TT ><TT ><A HREF="System-Directory.html#v%3ArenameDirectory" >renameDirectory</A ></TT > old new</TT > changes the name of an existing directory from <EM >old</EM > to <EM >new</EM >. If the <EM >new</EM > directory already exists, it is atomically replaced by the <EM >old</EM > directory. If the <EM >new</EM > directory is neither the <EM >old</EM > directory nor an alias of the <EM >old</EM > directory, it is removed as if by <TT ><A HREF="System-Directory.html#v%3AremoveDirectory" >removeDirectory</A ></TT >. A conformant implementation need not support renaming directories in all situations (e.g. renaming to an existing directory, or across different physical devices), but the constraints must be documented. </P ><P >On Win32 platforms, <TT >renameDirectory</TT > fails if the <EM >new</EM > directory already exists. </P ><P >The operation may fail with: </P ><UL ><LI > <TT >HardwareFault</TT > A physical I/O error has occurred. <TT >[EIO]</TT > </LI ><LI > <TT >InvalidArgument</TT > Either operand is not a valid directory name. <TT >[ENAMETOOLONG, ELOOP]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > / <TT >NoSuchThing</TT > The original directory does not exist, or there is no path to the target. <TT >[ENOENT, ENOTDIR]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisPermissionError" >isPermissionError</A ></TT > / <TT >PermissionDenied</TT > The process has insufficient privileges to perform the operation. <TT >[EROFS, EACCES, EPERM]</TT > </LI ><LI > <TT >ResourceExhausted</TT > Insufficient resources are available to perform the operation. <TT >[EDQUOT, ENOSPC, ENOMEM, EMLINK]</TT > </LI ><LI > <TT >UnsatisfiedConstraints</TT > Implementation-dependent constraints are not satisfied. <TT >[EBUSY, ENOTEMPTY, EEXIST]</TT > </LI ><LI > <TT >UnsupportedOperation</TT > The implementation does not support renaming in this situation. <TT >[EINVAL, EXDEV]</TT > </LI ><LI > <TT >InappropriateType</TT > Either path refers to an existing non-directory object. <TT >[ENOTDIR, EISDIR]</TT > </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getDirectoryContents" ><A NAME="v%3AgetDirectoryContents" ></A ></A ><B >getDirectoryContents</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</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="doc" ><P ><TT ><TT ><A HREF="System-Directory.html#v%3AgetDirectoryContents" >getDirectoryContents</A ></TT > dir</TT > returns a list of <EM >all</EM > entries in <EM >dir</EM >. </P ><P >The operation may fail with: </P ><UL ><LI > <TT >HardwareFault</TT > A physical I/O error has occurred. <TT >[EIO]</TT > </LI ><LI > <TT >InvalidArgument</TT > The operand is not a valid directory name. <TT >[ENAMETOOLONG, ELOOP]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > / <TT >NoSuchThing</TT > The directory does not exist. <TT >[ENOENT, ENOTDIR]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisPermissionError" >isPermissionError</A ></TT > / <TT >PermissionDenied</TT > The process has insufficient privileges to perform the operation. <TT >[EACCES]</TT > </LI ><LI > <TT >ResourceExhausted</TT > Insufficient resources are available to perform the operation. <TT >[EMFILE, ENFILE]</TT > </LI ><LI > <TT >InappropriateType</TT > The path refers to an existing non-directory object. <TT >[ENOTDIR]</TT > </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getCurrentDirectory" ><A NAME="v%3AgetCurrentDirectory" ></A ></A ><B >getCurrentDirectory</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" ><P >If the operating system has a notion of current directories, <TT ><A HREF="System-Directory.html#v%3AgetCurrentDirectory" >getCurrentDirectory</A ></TT > returns an absolute path to the current directory of the calling process. </P ><P >The operation may fail with: </P ><UL ><LI > <TT >HardwareFault</TT > A physical I/O error has occurred. <TT >[EIO]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > / <TT >NoSuchThing</TT > There is no path referring to the current directory. <TT >[EPERM, ENOENT, ESTALE...]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisPermissionError" >isPermissionError</A ></TT > / <TT >PermissionDenied</TT > The process has insufficient privileges to perform the operation. <TT >[EACCES]</TT > </LI ><LI > <TT >ResourceExhausted</TT > Insufficient resources are available to perform the operation. </LI ><LI > <TT >UnsupportedOperation</TT > The operating system has no notion of current directory. </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:setCurrentDirectory" ><A NAME="v%3AsetCurrentDirectory" ></A ></A ><B >setCurrentDirectory</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="doc" ><P >If the operating system has a notion of current directories, <TT ><TT ><A HREF="System-Directory.html#v%3AsetCurrentDirectory" >setCurrentDirectory</A ></TT > dir</TT > changes the current directory of the calling process to <EM >dir</EM >. </P ><P >The operation may fail with: </P ><UL ><LI > <TT >HardwareFault</TT > A physical I/O error has occurred. <TT >[EIO]</TT > </LI ><LI > <TT >InvalidArgument</TT > The operand is not a valid directory name. <TT >[ENAMETOOLONG, ELOOP]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > / <TT >NoSuchThing</TT > The directory does not exist. <TT >[ENOENT, ENOTDIR]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisPermissionError" >isPermissionError</A ></TT > / <TT >PermissionDenied</TT > The process has insufficient privileges to perform the operation. <TT >[EACCES]</TT > </LI ><LI > <TT >UnsupportedOperation</TT > The operating system has no notion of current directory, or the current directory cannot be dynamically changed. </LI ><LI > <TT >InappropriateType</TT > The path refers to an existing non-directory object. <TT >[ENOTDIR]</TT > </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="2" ><A NAME="2" >Pre-defined directories </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getHomeDirectory" ><A NAME="v%3AgetHomeDirectory" ></A ></A ><B >getHomeDirectory</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" ><P >Returns the current user's home directory. </P ><P >The directory returned is expected to be writable by the current user, but note that it isn't generally considered good practice to store application-specific data here; use <TT ><A HREF="System-Directory.html#v%3AgetAppUserDataDirectory" >getAppUserDataDirectory</A ></TT > instead. </P ><P >On Unix, <TT ><A HREF="System-Directory.html#v%3AgetHomeDirectory" >getHomeDirectory</A ></TT > returns the value of the <TT >HOME</TT > environment variable. On Windows, the system is queried for a suitable path; a typical path might be <TT >C:<EM >Documents And Settings</EM >user</TT >. </P ><P >The operation may fail with: </P ><UL ><LI > <TT >UnsupportedOperation</TT > The operating system has no notion of home directory. </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > The home directory for the current user does not exist, or cannot be found. </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getAppUserDataDirectory" ><A NAME="v%3AgetAppUserDataDirectory" ></A ></A ><B >getAppUserDataDirectory</B > :: <A HREF="../base/Data-Char.html#t%3AString" >String</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="doc" ><P >Returns the pathname of a directory in which application-specific data for the current user can be stored. The result of <TT ><A HREF="System-Directory.html#v%3AgetAppUserDataDirectory" >getAppUserDataDirectory</A ></TT > for a given application is specific to the current user. </P ><P >The argument should be the name of the application, which will be used to construct the pathname (so avoid using unusual characters that might result in an invalid pathname). </P ><P >Note: the directory may not actually exist, and may need to be created first. It is expected that the parent directory exists and is writable. </P ><P >On Unix, this function returns <TT >$HOME/.appName</TT >. On Windows, a typical path might be </P ><PRE > C:/Documents And Settings/user/Application Data/appName </PRE ><P >The operation may fail with: </P ><UL ><LI > <TT >UnsupportedOperation</TT > The operating system has no notion of application-specific data directory. </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > The home directory for the current user does not exist, or cannot be found. </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getUserDocumentsDirectory" ><A NAME="v%3AgetUserDocumentsDirectory" ></A ></A ><B >getUserDocumentsDirectory</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" ><P >Returns the current user's document directory. </P ><P >The directory returned is expected to be writable by the current user, but note that it isn't generally considered good practice to store application-specific data here; use <TT ><A HREF="System-Directory.html#v%3AgetAppUserDataDirectory" >getAppUserDataDirectory</A ></TT > instead. </P ><P >On Unix, <TT ><A HREF="System-Directory.html#v%3AgetUserDocumentsDirectory" >getUserDocumentsDirectory</A ></TT > returns the value of the <TT >HOME</TT > environment variable. On Windows, the system is queried for a suitable path; a typical path might be <TT >C:/Documents and Settings/user/My Documents</TT >. </P ><P >The operation may fail with: </P ><UL ><LI > <TT >UnsupportedOperation</TT > The operating system has no notion of document directory. </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > The document directory for the current user does not exist, or cannot be found. </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getTemporaryDirectory" ><A NAME="v%3AgetTemporaryDirectory" ></A ></A ><B >getTemporaryDirectory</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" ><P >Returns the current directory for temporary files. </P ><P >On Unix, <TT ><A HREF="System-Directory.html#v%3AgetTemporaryDirectory" >getTemporaryDirectory</A ></TT > returns the value of the <TT >TMPDIR</TT > environment variable or "/tmp" if the variable isn't defined. On Windows, the function checks for the existence of environment variables in the following order and uses the first path found: </P ><UL ><LI > TMP environment variable. </LI ><LI > TEMP environment variable. </LI ><LI > USERPROFILE environment variable. </LI ><LI > The Windows directory </LI ></UL ><P >The operation may fail with: </P ><UL ><LI > <TT >UnsupportedOperation</TT > The operating system has no notion of temporary directory. </LI ></UL ><P >The function doesn't verify whether the path exists. </P ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="3" ><A NAME="3" >Actions on files </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:removeFile" ><A NAME="v%3AremoveFile" ></A ></A ><B >removeFile</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="doc" ><P ><TT ><A HREF="System-Directory.html#v%3AremoveFile" >removeFile</A ></TT > <EM >file</EM > removes the directory entry for an existing file <EM >file</EM >, where <EM >file</EM > is not itself a directory. The implementation may specify additional constraints which must be satisfied before a file can be removed (e.g. the file may not be in use by other processes). </P ><P >The operation may fail with: </P ><UL ><LI > <TT >HardwareFault</TT > A physical I/O error has occurred. <TT >[EIO]</TT > </LI ><LI > <TT >InvalidArgument</TT > The operand is not a valid file name. <TT >[ENAMETOOLONG, ELOOP]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > / <TT >NoSuchThing</TT > The file does not exist. <TT >[ENOENT, ENOTDIR]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisPermissionError" >isPermissionError</A ></TT > / <TT >PermissionDenied</TT > The process has insufficient privileges to perform the operation. <TT >[EROFS, EACCES, EPERM]</TT > </LI ><LI > <TT >UnsatisfiedConstraints</TT > Implementation-dependent constraints are not satisfied. <TT >[EBUSY]</TT > </LI ><LI > <TT >InappropriateType</TT > The operand refers to an existing directory. <TT >[EPERM, EINVAL]</TT > </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:renameFile" ><A NAME="v%3ArenameFile" ></A ></A ><B >renameFile</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="doc" ><P ><TT ><TT ><A HREF="System-Directory.html#v%3ArenameFile" >renameFile</A ></TT > old new</TT > changes the name of an existing file system object from <EM >old</EM > to <EM >new</EM >. If the <EM >new</EM > object already exists, it is atomically replaced by the <EM >old</EM > object. Neither path may refer to an existing directory. A conformant implementation need not support renaming files in all situations (e.g. renaming across different physical devices), but the constraints must be documented. </P ><P >The operation may fail with: </P ><UL ><LI > <TT >HardwareFault</TT > A physical I/O error has occurred. <TT >[EIO]</TT > </LI ><LI > <TT >InvalidArgument</TT > Either operand is not a valid file name. <TT >[ENAMETOOLONG, ELOOP]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > / <TT >NoSuchThing</TT > The original file does not exist, or there is no path to the target. <TT >[ENOENT, ENOTDIR]</TT > </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisPermissionError" >isPermissionError</A ></TT > / <TT >PermissionDenied</TT > The process has insufficient privileges to perform the operation. <TT >[EROFS, EACCES, EPERM]</TT > </LI ><LI > <TT >ResourceExhausted</TT > Insufficient resources are available to perform the operation. <TT >[EDQUOT, ENOSPC, ENOMEM, EMLINK]</TT > </LI ><LI > <TT >UnsatisfiedConstraints</TT > Implementation-dependent constraints are not satisfied. <TT >[EBUSY]</TT > </LI ><LI > <TT >UnsupportedOperation</TT > The implementation does not support renaming in this situation. <TT >[EXDEV]</TT > </LI ><LI > <TT >InappropriateType</TT > Either path refers to an existing directory. <TT >[ENOTDIR, EISDIR, EINVAL, EEXIST, ENOTEMPTY]</TT > </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:copyFile" ><A NAME="v%3AcopyFile" ></A ></A ><B >copyFile</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="doc" ><TT ><TT ><A HREF="System-Directory.html#v%3AcopyFile" >copyFile</A ></TT > old new</TT > copies the existing file from <EM >old</EM > to <EM >new</EM >. If the <EM >new</EM > file already exists, it is atomically replaced by the <EM >old</EM > file. Neither path may refer to an existing directory. The permissions of <EM >old</EM > are copied to <EM >new</EM >, if possible. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:canonicalizePath" ><A NAME="v%3AcanonicalizePath" ></A ></A ><B >canonicalizePath</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</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="doc" >Given path referring to a file or directory, returns a canonicalized path, with the intent that two paths referring to the same file/directory will map to the same canonicalized path. Note that it is impossible to guarantee that the implication (same file/dir <=> same canonicalizedPath) holds in either direction: this function can make only a best-effort attempt. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:makeRelativeToCurrentDirectory" ><A NAME="v%3AmakeRelativeToCurrentDirectory" ></A ></A ><B >makeRelativeToCurrentDirectory</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</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="doc" ><TT ><A HREF="../filepath/System-FilePath-Posix.html#v%3AmakeRelative" >makeRelative</A ></TT > the current directory. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:findExecutable" ><A NAME="v%3AfindExecutable" ></A ></A ><B >findExecutable</B > :: <A HREF="../base/Data-Char.html#t%3AString" >String</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > (<A HREF="../base/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A >)</TD ></TR ><TR ><TD CLASS="doc" >Given an executable file name, searches for such file in the directories listed in system PATH. The returned value is the path to the found executable or Nothing if there isn't such executable. For example (findExecutable "ghc") gives you the path to GHC. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="4" ><A NAME="4" >Existence tests </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:doesFileExist" ><A NAME="v%3AdoesFileExist" ></A ></A ><B >doesFileExist</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ></TR ><TR ><TD CLASS="doc" >The operation <TT ><A HREF="System-Directory.html#v%3AdoesFileExist" >doesFileExist</A ></TT > returns <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3ATrue" >True</A ></TT > if the argument file exists and is not a directory, and <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3AFalse" >False</A ></TT > otherwise. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:doesDirectoryExist" ><A NAME="v%3AdoesDirectoryExist" ></A ></A ><B >doesDirectoryExist</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ></TR ><TR ><TD CLASS="doc" >The operation <TT ><A HREF="System-Directory.html#v%3AdoesDirectoryExist" >doesDirectoryExist</A ></TT > returns <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3ATrue" >True</A ></TT > if the argument file exists and is a directory, and <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3AFalse" >False</A ></TT > otherwise. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="5" ><A NAME="5" >Permissions </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="doc" ><P >The <TT ><A HREF="System-Directory.html#t%3APermissions" >Permissions</A ></TT > type is used to record whether certain operations are permissible on a file/directory. <TT ><A HREF="System-Directory.html#v%3AgetPermissions" >getPermissions</A ></TT > and <TT ><A HREF="System-Directory.html#v%3AsetPermissions" >setPermissions</A ></TT > get and set these permissions, respectively. Permissions apply both to files and directories. For directories, the executable field will be <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3AFalse" >False</A ></TT >, and for files the searchable field will be <TT ><A HREF="../ghc-prim/GHC-Bool.html#v%3AFalse" >False</A ></TT >. Note that directories may be searchable without being readable, if permission has been given to use them as part of a path, but not to examine the directory contents. </P ><P >Note that to change some, but not all permissions, a construct on the following lines must be used. </P ><PRE > makeReadable f = do p <- getPermissions f setPermissions f (p {readable = True}) </PRE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A NAME="t:Permissions" ><A NAME="t%3APermissions" ></A ></A ><B >Permissions</B > </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="section4" >Constructors</TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:Permissions" ><A NAME="v%3APermissions" ></A ></A ><B >Permissions</B ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="body" COLSPAN="2" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:readable" ><A NAME="v%3Areadable" ></A ></A ><B >readable</B > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:writable" ><A NAME="v%3Awritable" ></A ></A ><B >writable</B > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:executable" ><A NAME="v%3Aexecutable" ></A ></A ><B >executable</B > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:searchable" ><A NAME="v%3Asearchable" ></A ></A ><B >searchable</B > :: <A HREF="../ghc-prim/GHC-Bool.html#t%3ABool" >Bool</A ></TD ><TD CLASS="rdoc" ></TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="section4" ><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Permissions')" ALT="show/hide" > Instances</TD ></TR ><TR ><TD CLASS="body" ><DIV ID="i:Permissions" STYLE="display:block;" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="decl" ><A HREF="../base/Data-Eq.html#t%3AEq" >Eq</A > <A HREF="System-Directory.html#t%3APermissions" >Permissions</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="../base/Data-Ord.html#t%3AOrd" >Ord</A > <A HREF="System-Directory.html#t%3APermissions" >Permissions</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="../base/Text-Read.html#t%3ARead" >Read</A > <A HREF="System-Directory.html#t%3APermissions" >Permissions</A ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="../base/Text-Show.html#t%3AShow" >Show</A > <A HREF="System-Directory.html#t%3APermissions" >Permissions</A ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getPermissions" ><A NAME="v%3AgetPermissions" ></A ></A ><B >getPermissions</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="System-Directory.html#t%3APermissions" >Permissions</A ></TD ></TR ><TR ><TD CLASS="doc" ><P >The <TT ><A HREF="System-Directory.html#v%3AgetPermissions" >getPermissions</A ></TT > operation returns the permissions for the file or directory. </P ><P >The operation may fail with: </P ><UL ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisPermissionError" >isPermissionError</A ></TT > if the user is not permitted to access the permissions; or </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > if the file or directory does not exist. </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:setPermissions" ><A NAME="v%3AsetPermissions" ></A ></A ><B >setPermissions</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="System-Directory.html#t%3APermissions" >Permissions</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="doc" ><P >The <TT ><A HREF="System-Directory.html#v%3AsetPermissions" >setPermissions</A ></TT > operation sets the permissions for the file or directory. </P ><P >The operation may fail with: </P ><UL ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisPermissionError" >isPermissionError</A ></TT > if the user is not permitted to set the permissions; or </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > if the file or directory does not exist. </LI ></UL ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" ><A NAME="6" ><A NAME="6" >Timestamps </A ></A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getModificationTime" ><A NAME="v%3AgetModificationTime" ></A ></A ><B >getModificationTime</B > :: <A HREF="../base/System-IO.html#t%3AFilePath" >FilePath</A > -> <A HREF="../base/System-IO.html#t%3AIO" >IO</A > <A HREF="../old-time/System-Time.html#t%3AClockTime" >ClockTime</A ></TD ></TR ><TR ><TD CLASS="doc" ><P >The <TT ><A HREF="System-Directory.html#v%3AgetModificationTime" >getModificationTime</A ></TT > operation returns the clock time at which the file or directory was last modified. </P ><P >The operation may fail with: </P ><UL ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisPermissionError" >isPermissionError</A ></TT > if the user is not permitted to access the modification time; or </LI ><LI > <TT ><A HREF="../base/System-IO-Error.html#v%3AisDoesNotExistError" >isDoesNotExistError</A ></TT > if the file or directory does not exist. </LI ></UL ></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 >