Module "FileGoodies.curry"

A collection of useful operations when dealing with files.

Author: Michael Hanus, Bernd Brassel

Version: June 2009


 Exported names:

Functions:
baseName | dirName | fileSuffix | findFileInPath | getFileInPath | isAbsolute | lookupFileInPath | pathSeparatorChar | separatorChar | splitBaseName | splitDirectoryBaseName | splitPath | stripSuffix | suffixSeparatorChar


 Summary of exported functions:

separatorChar  :: Char  deterministic 
          The character for separating hierarchies in file names.
pathSeparatorChar  :: Char  deterministic 
          The character for separating names in path expressions.
suffixSeparatorChar  :: Char  deterministic 
          The character for separating suffixes in file names.
isAbsolute  :: String -> Bool  deterministic flexible
          Is the argument an absolute name?
dirName  :: String -> String  deterministic 
          Extracts the directoy prefix of a given (Unix) file name.
baseName  :: String -> String  deterministic 
          Extracts the base name without directoy prefix of a given (Unix) file name.
splitDirectoryBaseName  :: String -> (String,String)  deterministic rigid
          Splits a (Unix) file name into the directory prefix and the base name.
stripSuffix  :: String -> String  deterministic 
          Strips a suffix (the last suffix starting with a dot) from a file name.
fileSuffix  :: String -> String  deterministic 
          Yields the suffix (the last suffix starting with a dot) from given file name.
splitBaseName  :: String -> (String,String)  deterministic rigid
          Splits a file name into prefix and suffix (the last suffix starting with a dot and the rest).
splitPath  :: String -> [String]  deterministic flexible+rigid
          Splits a path string into list of directory names.
findFileInPath  :: String -> [String] -> [String] -> IO (Maybe String)  deterministic 
          Included for backward compatibility.
lookupFileInPath  :: String -> [String] -> [String] -> IO (Maybe String)  deterministic rigid
          Looks up the first file with a possible suffix in a list of directories.
getFileInPath  :: String -> [String] -> [String] -> IO String  deterministic 
          Gets the first file with a possible suffix in a list of directories.

 Imported modules:

Directory
List
Prelude

 Exported datatypes:


 Exported functions:

separatorChar :: Char  deterministic 

The character for separating hierarchies in file names. On UNIX systems the value is '/'.

Further infos:
  • solution complete, i.e., able to compute all solutions

pathSeparatorChar :: Char  deterministic 

The character for separating names in path expressions. On UNIX systems the value is ':'.

Further infos:
  • solution complete, i.e., able to compute all solutions

suffixSeparatorChar :: Char  deterministic 

The character for separating suffixes in file names. On UNIX systems the value is '.'.

Further infos:
  • solution complete, i.e., able to compute all solutions

isAbsolute :: String -> Bool  deterministic flexible

Is the argument an absolute name?

Further infos:
  • incompletely defined

dirName :: String -> String  deterministic 

Extracts the directoy prefix of a given (Unix) file name. Returns "." if there is no prefix.


baseName :: String -> String  deterministic 

Extracts the base name without directoy prefix of a given (Unix) file name.


splitDirectoryBaseName :: String -> (String,String)  deterministic rigid

Splits a (Unix) file name into the directory prefix and the base name. The directory prefix is "." if there is no real prefix in the name.


stripSuffix :: String -> String  deterministic 

Strips a suffix (the last suffix starting with a dot) from a file name.


fileSuffix :: String -> String  deterministic 

Yields the suffix (the last suffix starting with a dot) from given file name.


splitBaseName :: String -> (String,String)  deterministic rigid

Splits a file name into prefix and suffix (the last suffix starting with a dot and the rest).


splitPath :: String -> [String]  deterministic flexible+rigid

Splits a path string into list of directory names.


findFileInPath :: String -> [String] -> [String] -> IO (Maybe String)  deterministic 

Included for backward compatibility. Use lookupFileInPath instead!


lookupFileInPath :: String -> [String] -> [String] -> IO (Maybe String)  deterministic rigid

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

Further infos:
  • incompletely defined

getFileInPath :: 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.



Generated by CurryDoc (Version 0.4.1 of June 7, 2007) at Nov 9 18:02:13 2009