addExtension

addExtension :: FilePath -> String -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Add an extension, even if there is already one there. E.g. addExtension "foo.txt" "bat" -> "foo.txt.bat". > addExtension "file.txt" "bib" == "file.txt.bib" > addExtension "file." ".bib" == "file..bib" > addExtension "file" ".bib" == "file.bib" > addExtension "/" "x" == "/.x" > Valid x => takeFileName (addExtension (addTrailingPathSeparator x) "ext") == ".ext" > Windows: addExtension "\\\\share" ".txt" == "\\\\share\\.txt"