Module System.Directory

Library for accessing the directory structure of the underlying operating system.

Author: Michael Hanus

Version: January 2013

Summary of exported operations:

doesFileExist :: String -> IO Bool  Deterministic 
Returns true if the argument is the name of an existing file.
doesDirectoryExist :: String -> IO Bool  Deterministic 
Returns true if the argument is the name of an existing directory.
getFileSize :: String -> IO Int  Deterministic 
Returns the size of the file.
getModificationTime :: String -> IO ClockTime  Deterministic 
Returns the modification time of the file.
getCurrentDirectory :: IO String  Deterministic 
Returns the current working directory.
setCurrentDirectory :: String -> IO ()  Deterministic 
Sets the current working directory.
getDirectoryContents :: String -> IO [String]  Deterministic 
Returns the list of all entries in a directory.
createDirectory :: String -> IO ()  Deterministic 
Creates a new directory with the given name.
createDirectoryIfMissing :: Bool -> String -> IO ()  Deterministic 
Creates a new directory with the given name if it does not already exist.
removeDirectory :: String -> IO ()  Deterministic 
Deletes a directory from the file system.
renameDirectory :: String -> String -> IO ()  Deterministic 
Renames a directory.
getHomeDirectory :: IO String  Deterministic 
Returns the home directory of the current user.
getTemporaryDirectory :: IO String  Deterministic 
Returns the temporary directory of the operating system.
getAbsolutePath :: String -> IO String  Deterministic 
Convert a path name into an absolute one.
removeFile :: String -> IO ()  Deterministic 
Deletes a file from the file system.
renameFile :: String -> String -> IO ()  Deterministic 
Renames a file.
copyFile :: String -> String -> IO ()  Deterministic 
Copy the contents from one file to another file
findFileWithSuffix :: String -> [String] -> [String] -> IO (Maybe String)  Deterministic 
Looks up the first file with a possible suffix in a list of directories.
getFileWithSuffix :: String -> [String] -> [String] -> IO String  Deterministic 
Gets the first file with a possible suffix in a list of directories.

Exported operations:

doesFileExist :: String -> IO Bool  Deterministic 

Returns true if the argument is the name of an existing file.

doesDirectoryExist :: String -> IO Bool  Deterministic 

Returns true if the argument is the name of an existing directory.

getFileSize :: String -> IO Int  Deterministic 

Returns the size of the file.

getModificationTime :: String -> IO ClockTime  Deterministic 

Returns the modification time of the file.

getCurrentDirectory :: IO String  Deterministic 

Returns the current working directory.

Further infos:
  • externally defined

setCurrentDirectory :: String -> IO ()  Deterministic 

Sets the current working directory.

getDirectoryContents :: String -> IO [String]  Deterministic 

Returns the list of all entries in a directory.

createDirectory :: String -> IO ()  Deterministic 

Creates a new directory with the given name.

createDirectoryIfMissing :: Bool -> String -> IO ()  Deterministic 

Creates a new directory with the given name if it does not already exist. If the first parameter is True it will also create all missing parent directories.

removeDirectory :: String -> IO ()  Deterministic 

Deletes a directory from the file system.

renameDirectory :: String -> String -> IO ()  Deterministic 

Renames a directory.

getHomeDirectory :: IO String  Deterministic 

Returns the home directory of the current user.

getTemporaryDirectory :: IO String  Deterministic 

Returns the temporary directory of the operating system.

getAbsolutePath :: String -> IO String  Deterministic 

Convert a path name into an absolute one. For instance, a leading ~ is replaced by the current home directory.

removeFile :: String -> IO ()  Deterministic 

Deletes a file from the file system.

renameFile :: String -> String -> IO ()  Deterministic 

Renames a file.

copyFile :: String -> String -> IO ()  Deterministic 

Copy the contents from one file to another file

findFileWithSuffix :: String -> [String] -> [String] -> IO (Maybe String)  Deterministic 

Looks up the first file with a possible suffix in a list of directories. Returns Nothing if such a file does not exist.

getFileWithSuffix :: String -> [String] -> [String] -> IO String  Deterministic 

Gets the first file with a possible suffix in a list of directories. An error message is delivered if there is no such file.