Copyright | Dennis Gosnell 2017 |
---|---|
License | BSD3 |
Maintainer | Dennis Gosnell (cdep.illabout@gmail.com) |
Stability | experimental |
Portability | unknown |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Read a directory and the contents of all the files in it as a FileTree
.
Synopsis
- data FileTree
- data FileType
- getFileType :: FilePath -> IO FileType
- fileTypeToFileTree :: FileType -> IO (Maybe FileTree)
- getFileTree :: FilePath -> IO [FileTree]
- getFileTreeIgnoreEmpty :: FilePath -> IO (NonEmpty FileTree)
Documentation
This tree structure represents the directory structure on disk.
FileTreeFile FilePath ByteString | A file with it's |
FileTreeDir FilePath (NonEmpty FileTree) | A directory with it's |
This is a simple version of FileTree
, just used for tagging a given
FilePath
as a directory or a file.
fileTypeToFileTree :: FileType -> IO (Maybe FileTree) Source #
Convert a FileType
to a FileTree
. Return Nothing
if the input
FileType
is FileTypeDir
, and that directory is empty.
getFileTreeIgnoreEmpty :: FilePath -> IO (NonEmpty FileTree) Source #
Just like getFileTree
, but returns an error with fail
if the input
directory is empty.