SlurpDirectory is intended to give a nice lazy way of traversing directory trees.
- data Slurpy = Slurpy !FileName !SlurpyContents
- data SlurpyContents
- = SlurpDir (Maybe String) SlurpyMap
- | SlurpFile (Maybe String, EpochTime, FileOffset) FileContents
- slurpies_to_map :: [Slurpy] -> SlurpyMap
- map_to_slurpies :: SlurpyMap -> [Slurpy]
- type FileContents = ByteString
- empty_slurpy :: Slurpy
- slurp :: FilePathLike p => p -> IO Slurpy
- mmap_slurp :: FilePath -> IO Slurpy
- slurp_unboring :: (FilePath -> Bool) -> FilePath -> IO Slurpy
- co_slurp :: Slurpy -> FilePath -> IO Slurpy
- slurp_name :: Slurpy -> FilePath
- is_file :: Slurpy -> Bool
- is_dir :: Slurpy -> Bool
- get_filecontents :: Slurpy -> FileContents
- get_dircontents :: Slurpy -> [Slurpy]
- get_mtime :: Slurpy -> EpochTime
- get_length :: Slurpy -> FileOffset
- get_slurp :: FileName -> Slurpy -> Maybe Slurpy
- slurp_removefile :: FileName -> Slurpy -> Maybe Slurpy
- slurp_removedir :: FileName -> Slurpy -> Maybe Slurpy
- slurp_remove :: FileName -> Slurpy -> Maybe Slurpy
- slurp_modfile :: FileName -> (FileContents -> Maybe FileContents) -> Slurpy -> Maybe Slurpy
- slurp_hasfile :: FileName -> Slurpy -> Bool
- slurp_hasdir :: FileName -> Slurpy -> Bool
- slurp_has_anycase :: FilePath -> Slurpy -> Bool
- undefined_time :: EpochTime
- undefined_size :: FileOffset
- slurp_has :: FilePath -> Slurpy -> Bool
- list_slurpy :: Slurpy -> [FilePath]
- list_slurpy_files :: Slurpy -> [FilePath]
- get_path_list :: Slurpy -> FilePath -> [FilePath]
- list_slurpy_dirs :: Slurpy -> [FilePath]
- isFileReallySymlink :: FilePath -> IO Bool
- doesFileReallyExist :: FilePath -> IO Bool
- doesDirectoryReallyExist :: FilePath -> IO Bool
- data SlurpMonad a
- withSlurpy :: Slurpy -> SlurpMonad a -> Either String (Slurpy, a)
- write_files :: Slurpy -> [FilePath] -> IO ()
- writeSlurpy :: Slurpy -> FilePath -> IO ()
- syncSlurpy :: (Slurpy -> IO Slurpy) -> Slurpy -> IO Slurpy
Documentation
data SlurpyContents Source
SlurpDir (Maybe String) SlurpyMap | |
SlurpFile (Maybe String, EpochTime, FileOffset) FileContents |
slurpies_to_map :: [Slurpy] -> SlurpyMapSource
map_to_slurpies :: SlurpyMap -> [Slurpy]Source
type FileContents = ByteStringSource
slurp :: FilePathLike p => p -> IO SlurpySource
mmap_slurp :: FilePath -> IO SlurpySource
slurp_name :: Slurpy -> FilePathSource
get_dircontents :: Slurpy -> [Slurpy]Source
get_length :: Slurpy -> FileOffsetSource
slurp_remove :: FileName -> Slurpy -> Maybe SlurpySource
A variant of get_slurp_context
that allows for replacing the child slurpy by
a list of slurpies. The result of the update function will always be a singleton
list unless the child slurpy was at the top level.
Currently unused.
get_slurp_context_list :: FileName -> Slurpy -> Maybe ([Slurpy] -> [Slurpy], Slurpy)
get_slurp_context_list = get_slurp_context_generic return id
It is important to be able to readily modify a slurpy.
slurp_modfile :: FileName -> (FileContents -> Maybe FileContents) -> Slurpy -> Maybe SlurpySource
Code to modify a given file in a slurpy.
slurp_hasfile :: FileName -> Slurpy -> BoolSource
slurp_hasdir :: FileName -> Slurpy -> BoolSource
slurp_has_anycase :: FilePath -> Slurpy -> BoolSource
list_slurpy :: Slurpy -> [FilePath]Source
list_slurpy_files :: Slurpy -> [FilePath]Source
get_path_list :: Slurpy -> FilePath -> [FilePath]Source
list_slurpy_dirs :: Slurpy -> [FilePath]Source
data SlurpMonad a Source
withSlurpy :: Slurpy -> SlurpMonad a -> Either String (Slurpy, a)Source