TESTS: add getFileTypeSpec

This commit is contained in:
2016-05-02 22:13:19 +02:00
parent ac41b053e3
commit 5670b160d8
8 changed files with 65 additions and 3 deletions

View File

@@ -184,7 +184,7 @@ data FileType = Directory
| CharacterDevice
| NamedPipe
| Socket
deriving (Show)
deriving (Eq, Show)
@@ -614,6 +614,13 @@ getDirsFiles p =
---------------------------
-- |Get the file type of the file located at the given path. Does
-- not follow symbolic links.
--
-- Throws:
--
-- - `NoSuchThing` if the file does not exist
-- - `PermissionDenied` if any part of the path is not accessible
getFileType :: Path Abs -> IO FileType
getFileType p = do
fs <- PF.getSymbolicLinkStatus (P.fromAbs p)