A collection of useful operations when dealing with files.
Author: Michael Hanus, Bernd Brassel
Version: June 2009
Functions:
baseName
| dirName
| fileSuffix
| findFileInPath
| getFileInPath
| isAbsolute
| lookupFileInPath
| pathSeparatorChar
| separatorChar
| splitBaseName
| splitDirectoryBaseName
| splitPath
| stripSuffix
| suffixSeparatorChar
|
Summary of exported functions:
|
separatorChar :: Char
|
|
The character for separating hierarchies in file names.
|
|
|
|
|
|
isAbsolute :: String -> Bool
|
|
Is the argument an absolute name?
|
|
dirName :: String -> String
|
|
Extracts the directoy prefix of a given (Unix) file name.
|
|
baseName :: String -> String
|
|
Extracts the base name without directoy prefix of a given (Unix) file name.
|
|
splitDirectoryBaseName :: String -> (String,String)
|
|
Splits a (Unix) file name into the directory prefix and the base name.
|
|
stripSuffix :: String -> String
|
|
Strips a suffix (the last suffix starting with a dot) from a file name.
|
|
fileSuffix :: String -> String
|
|
Yields the suffix (the last suffix starting with a dot) from given file name.
|
|
splitBaseName :: String -> (String,String)
|
|
Splits a file name into prefix and suffix (the last suffix starting with a dot
and the rest).
|
|
splitPath :: String -> [String]
|
|
Splits a path string into list of directory names.
|
|
findFileInPath :: String -> [String] -> [String] -> IO (Maybe String)
|
|
Included for backward compatibility.
|
|
lookupFileInPath :: String -> [String] -> [String] -> IO (Maybe String)
|
|
Looks up the first file with a possible suffix in a list of directories.
|
|
getFileInPath :: String -> [String] -> [String] -> IO String
|
|
Gets the first file with a possible suffix in a list of directories.
|
|
Directory
List
Prelude
separatorChar :: Char
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
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
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
Is the argument an absolute name?
-
Further infos:
-
dirName :: String -> String
Extracts the directoy prefix of a given (Unix) file name.
Returns "." if there is no prefix.
baseName :: String -> String
Extracts the base name without directoy prefix of a given (Unix) file name.
splitDirectoryBaseName :: String -> (String,String)
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
Strips a suffix (the last suffix starting with a dot) from a file name.
fileSuffix :: String -> String
Yields the suffix (the last suffix starting with a dot) from given file name.
splitBaseName :: String -> (String,String)
Splits a file name into prefix and suffix (the last suffix starting with a dot
and the rest).
splitPath :: String -> [String]
Splits a path string into list of directory names.
findFileInPath :: String -> [String] -> [String] -> IO (Maybe String)
Included for backward compatibility.
Use lookupFileInPath instead!
lookupFileInPath :: String -> [String] -> [String] -> IO (Maybe String)
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:
-
getFileInPath :: String -> [String] -> [String] -> IO String
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