|Julian Ospald 809ffc7745 Add unsafeToString methods||1 year ago|
|cbits||3 years ago|
|src||1 year ago|
|test||1 year ago|
|.ghci||4 years ago|
|.gitignore||1 year ago|
|.travis.yml||1 year ago|
|CHANGELOG||1 year ago|
|LICENSE||3 years ago|
|README.md||1 year ago|
|Setup.hs||4 years ago|
|doctests-hpath.hs||1 year ago|
|doctests-posix.hs||3 years ago|
|hpath.cabal||1 year ago|
|stack.yaml||1 year ago|
|update-gh-pages.sh||3 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)