From c570505297f22fda08248dae66072c9bff9ce607 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 10 Apr 2016 21:50:52 +0200 Subject: [PATCH] Add hiddenFile function --- src/HPath.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/HPath.hs b/src/HPath.hs index 5002af7..9452c70 100644 --- a/src/HPath.hs +++ b/src/HPath.hs @@ -72,6 +72,8 @@ module HPath ,stripPrefix ,takeDirectory ,userStringToFP + -- * ByteString Query functions + ,hiddenFile -- * Queries ,hasDot ,hasDoublePS @@ -309,6 +311,15 @@ basename (MkPath l) rl = last . splitPath . dropTrailingPathSeparator $ l +-------------------------------------------------------------------------------- +-- ByteString Query functions + +hiddenFile :: Path Fn -> Bool +hiddenFile (Path ".") = False +hiddenFile (Path "..") = False +hiddenFile p = "." `B.isPrefixOf` fromRel p + + -------------------------------------------------------------------------------- -- ByteString/Word8 constants