filepath
filepath copied to clipboard
Haskell FilePath core library
Windows seems to interpret paths differently than on POSIX systems. - On POSIX, `/sym/link/../foo` refers to `/target/dir/../foo ≡ /target/foo` (`..` expands after dereferencing). - On Windows, `C:\sym\link\..\foo` always refers to...
Is there really no function to get the root directory? 😳 ```hs rootDirectory :: FilePath -> FilePat rootDirectory "/directory/other.ext" == "/" rootDirectory "directory/other.ext" == "directory" rootDirectory "/foo/bar/baz" == "/" rootDirectory...
The intention is to strip away a common prefix and return the relative FilePath, if and only if there is a common prefix. Possible function signature: ```haskell stripPrefix :: --...
It may be interesting to have benchmarks, in case the internal filepath representation changes and we want to understand both time and space.
In the Windows version of the API, `"//foo" "txt" == "//foo\\.txt"`. That's not what anyone expects, and doesn't match the .NET conventions for filepaths. It also means Shake can't use...
Two useful properties of filepath operators are being idempotent (as you might hope `normalise` was) and being valid lenses, specifically obeying: ``` view l (set l b a) = b...
Migrated from https://ghc.haskell.org/trac/ghc/ticket/8752: ## @joeyh said: "Combine two paths, if the second path isAbsolute, then it returns the second." But, the implementation of combine checks if the first character of...
``` writeFile "foo " "" writeFile "bar" "" doesFileExist "foo" -- True doesFileExist "foo " -- True doesFileExist "bar " -- True ``` Seemingly any trailing spaces in a path...
While working on https://github.com/commercialhaskell/path/pull/192 I noted that it might be helpful to have a separate type for a path component for some use cases. Since we have the nice AFPP-style...
I'm trying to read and write lists of OsPaths (actually just PosixPaths in case that matters) to files. I want to avoid doing any conversion or interpretation if possible---just treat...