Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Development.Shake.FilePath
Description
A module for FilePath
operations exposing System.FilePath plus some additional operations.
Windows note: The extension methods (<.>
, takeExtension
etc) use the Posix variants since on
Windows "//*"
produces <.>
"txt""//*\\.txt"
(which is bad for FilePattern
values).
Synopsis
- type FilePath = String
- (</>) :: FilePath -> FilePath -> FilePath
- addTrailingPathSeparator :: FilePath -> FilePath
- combine :: FilePath -> FilePath -> FilePath
- dropDrive :: FilePath -> FilePath
- dropFileName :: FilePath -> FilePath
- dropTrailingPathSeparator :: FilePath -> FilePath
- equalFilePath :: FilePath -> FilePath -> Bool
- extSeparator :: Char
- getSearchPath :: IO [FilePath]
- hasDrive :: FilePath -> Bool
- hasTrailingPathSeparator :: FilePath -> Bool
- isAbsolute :: FilePath -> Bool
- isDrive :: FilePath -> Bool
- isExtSeparator :: Char -> Bool
- isExtensionOf :: String -> FilePath -> Bool
- isPathSeparator :: Char -> Bool
- isRelative :: FilePath -> Bool
- isSearchPathSeparator :: Char -> Bool
- isValid :: FilePath -> Bool
- joinDrive :: FilePath -> FilePath -> FilePath
- joinPath :: [FilePath] -> FilePath
- makeRelative :: FilePath -> FilePath -> FilePath
- makeValid :: FilePath -> FilePath
- normalise :: FilePath -> FilePath
- pathSeparator :: Char
- pathSeparators :: [Char]
- replaceBaseName :: FilePath -> String -> FilePath
- replaceDirectory :: FilePath -> String -> FilePath
- replaceExtensions :: FilePath -> String -> FilePath
- replaceFileName :: FilePath -> String -> FilePath
- searchPathSeparator :: Char
- splitDirectories :: FilePath -> [FilePath]
- splitDrive :: FilePath -> (FilePath, FilePath)
- splitFileName :: FilePath -> (String, String)
- splitPath :: FilePath -> [FilePath]
- splitSearchPath :: String -> [FilePath]
- stripExtension :: String -> FilePath -> Maybe FilePath
- takeBaseName :: FilePath -> String
- takeDirectory :: FilePath -> FilePath
- takeDrive :: FilePath -> FilePath
- takeFileName :: FilePath -> FilePath
- (-<.>) :: FilePath -> String -> FilePath
- (<.>) :: FilePath -> String -> FilePath
- addExtension :: FilePath -> String -> FilePath
- dropExtension :: FilePath -> FilePath
- dropExtensions :: FilePath -> FilePath
- hasExtension :: FilePath -> Bool
- replaceExtension :: FilePath -> String -> FilePath
- splitExtension :: FilePath -> (String, String)
- splitExtensions :: FilePath -> (FilePath, String)
- takeExtension :: FilePath -> String
- takeExtensions :: FilePath -> String
- dropDirectory1 :: FilePath -> FilePath
- takeDirectory1 :: FilePath -> FilePath
- normaliseEx :: FilePath -> FilePath
- toNative :: FilePath -> FilePath
- toStandard :: FilePath -> FilePath
- exe :: String
Documentation
dropFileName :: FilePath -> FilePath #
equalFilePath :: FilePath -> FilePath -> Bool #
extSeparator :: Char #
getSearchPath :: IO [FilePath] #
hasTrailingPathSeparator :: FilePath -> Bool #
isAbsolute :: FilePath -> Bool #
isExtSeparator :: Char -> Bool #
isExtensionOf :: String -> FilePath -> Bool #
isPathSeparator :: Char -> Bool #
isRelative :: FilePath -> Bool #
isSearchPathSeparator :: Char -> Bool #
makeRelative :: FilePath -> FilePath -> FilePath #
pathSeparator :: Char #
pathSeparators :: [Char] #
replaceBaseName :: FilePath -> String -> FilePath #
replaceDirectory :: FilePath -> String -> FilePath #
replaceExtensions :: FilePath -> String -> FilePath #
replaceFileName :: FilePath -> String -> FilePath #
searchPathSeparator :: Char #
splitDirectories :: FilePath -> [FilePath] #
splitDrive :: FilePath -> (FilePath, FilePath) #
splitFileName :: FilePath -> (String, String) #
splitSearchPath :: String -> [FilePath] #
stripExtension :: String -> FilePath -> Maybe FilePath #
takeBaseName :: FilePath -> String #
takeDirectory :: FilePath -> FilePath #
takeFileName :: FilePath -> FilePath #
addExtension :: FilePath -> String -> FilePath #
dropExtension :: FilePath -> FilePath #
dropExtensions :: FilePath -> FilePath #
hasExtension :: FilePath -> Bool #
replaceExtension :: FilePath -> String -> FilePath #
splitExtension :: FilePath -> (String, String) #
splitExtensions :: FilePath -> (FilePath, String) #
takeExtension :: FilePath -> String #
takeExtensions :: FilePath -> String #
dropDirectory1 :: FilePath -> FilePath Source #
Drop the first directory from a FilePath
. Should only be used on
relative paths.
dropDirectory1 "aaa/bbb" == "bbb" dropDirectory1 "aaa/" == "" dropDirectory1 "aaa" == "" dropDirectory1 "" == ""
takeDirectory1 :: FilePath -> FilePath Source #
Take the first component of a FilePath
. Should only be used on
relative paths.
takeDirectory1 "aaa/bbb" == "aaa" takeDirectory1 "aaa/" == "aaa" takeDirectory1 "aaa" == "aaa"
normaliseEx :: FilePath -> FilePath Source #
Normalise a FilePath
, applying the rules:
- All
pathSeparators
becomepathSeparator
(/
on Linux,\
on Windows) foo/bar/../baz
becomesfoo/baz
(not universally true in the presence of symlinks)foo/./bar
becomesfoo/bar
foo//bar
becomesfoo/bar
This function is not based on the normalise
function from the filepath
library, as that function
is quite broken.
toStandard :: FilePath -> FilePath Source #
Convert all path separators to /
, even on Windows.