hpath-filepath 0.10.3 → 0.10.4
raw patch · 4 files changed
+29/−3 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ System.Posix.FilePath: takeAllParents :: RawFilePath -> [RawFilePath]
Files
- CHANGELOG.md +5/−0
- README.md +5/−1
- hpath-filepath.cabal +1/−1
- src/System/Posix/FilePath.hs +18/−1
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for hpath-filepath +## 0.10.4 -- 2020-01-26++* Add `takeAllParents`++ ## 0.10.2 -- 2020-01-18 * Add `isSpecialDirectoryEntry`
README.md view
@@ -4,7 +4,11 @@ Support for bytestring based filepath manipulation, similar to 'filepath'. -This package is part of the HPath suite, also check out [hpath](https://hackage.haskell.org/package/hpath) and [hpath-io](https://hackage.haskell.org/package/hpath-io).+This package is part of the HPath suite, also check out:++* [hpath](https://hackage.haskell.org/package/hpath)+* [hpath-directory](https://hackage.haskell.org/package/hpath-directory)+* [hpath-io](https://hackage.haskell.org/package/hpath-io) ## Motivation
hpath-filepath.cabal view
@@ -1,5 +1,5 @@ name: hpath-filepath-version: 0.10.3+version: 0.10.4 synopsis: ByteString based filepath manipulation description: ByteString based filepath manipulation, similar to 'filepath' package. This is POSIX only. -- bug-reports:
src/System/Posix/FilePath.hs view
@@ -59,6 +59,7 @@ , splitPath , joinPath , splitDirectories+, takeAllParents -- * Trailing slash functions , hasTrailingPathSeparator@@ -500,7 +501,22 @@ splitter = filter (not . BS.null) . BS.split pathSeparator +-- |Get all parents of a path.+--+-- >>> takeAllParents "/abs/def/dod"+-- ["/abs/def","/abs","/"]+-- >>> takeAllParents "/foo"+-- ["/"]+-- >>> takeAllParents "/"+-- []+takeAllParents :: RawFilePath -> [RawFilePath]+takeAllParents p+ | np == BS.singleton pathSeparator = []+ | otherwise = takeDirectory np : takeAllParents (takeDirectory np)+ where+ np = normalise p + ------------------------ -- Trailing slash functions @@ -727,7 +743,8 @@ | otherwise = BS.map (\x -> if x == _nul then _underscore else x) path --- | Is a FilePath valid, i.e. could you create a file like it?+-- | Whether the filename is a special directory entry+-- (. and ..). Does not normalise filepaths. -- -- >>> isSpecialDirectoryEntry "." -- True