|Julian Ospald 809ffc7745 Add unsafeToString methods||4 months ago|
|cbits||2 years ago|
|src||4 months ago|
|test||4 months ago|
|.ghci||3 years ago|
|.gitignore||4 months ago|
|.travis.yml||8 months ago|
|CHANGELOG||8 months ago|
|LICENSE||2 years ago|
|README.md||6 months ago|
|Setup.hs||3 years ago|
|doctests-hpath.hs||4 months ago|
|doctests-posix.hs||2 years ago|
|hpath.cabal||8 months ago|
|stack.yaml||4 months ago|
|update-gh-pages.sh||2 years ago|
Support for well-typed paths in Haskell. Also provides ByteString based filepath manipulation.
The motivation came during development of hsfm which has a pretty strict File type, but lacks a strict Path type, e.g. for user input.
The library that came closest to my needs was path, but the API turned out to be oddly complicated for my use case, so I decided to fork it.
Similarly, posix-paths was exactly what I wanted for the low-level operations, but upstream seems dead, so it is forked as well and merged into this library.
Note: this library was written for posix systems and it will probably not support other systems.
Path Fnfor safe filename guarantees and a
~/as relative path, because on posix level
~is just a regular filename that does NOT point to
word8package for save word8 literals instead of
dropTrailingPathSeparatorbehave in the same way as their
openFdwhich allows more control over the flags than its unix package counterpart
getDirectoryContents'version that works on Fd
Start ghci via
-- enable OverloadedStrings :set -XOverloadedStrings -- import HPath.IO import HPath.IO -- parse an absolute path abspath <- parseAbs "/home" -- parse a relative path (e.g. user users home directory) relpath <- parseRel "jule" -- concatenate paths let newpath = abspath </> relpath -- get file type getFileType newpath -- return all contents of that directory getDirsFiles newpath -- return all contents of the parent directory getDirsFiles (dirname newpath)