hpath-0.7.3: Support for well-typed paths

Copyright© 2016 Julian Ospald
LicenseBSD3
MaintainerJulian Ospald <hasufell@posteo.de>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

System.Posix.Directory.Traversals

Description

Traversal and read operations on directories.

Synopsis

Documentation

getDirectoryContents :: RawFilePath -> IO [(DirType, RawFilePath)] Source #

Gets all directory contents (not recursively).

getDirectoryContents' :: Fd -> IO [(DirType, RawFilePath)] Source #

Like getDirectoryContents except for a file descriptor.

To avoid complicated error checks, the file descriptor is always closed, even if fdOpendir fails. Usually, this only happens on successful fdOpendir and after the directory stream is closed. Also see the manpage of fdopendir(3) for more details.

allDirectoryContents :: RawFilePath -> IO [RawFilePath] Source #

Get all files from a directory and its subdirectories.

Upon entering a directory, allDirectoryContents will get all entries strictly. However the returned list is lazy in that directories will only be accessed on demand.

Follows symbolic links for the input dir.

allDirectoryContents' :: RawFilePath -> IO [RawFilePath] Source #

Get all files from a directory and its subdirectories strictly.

Follows symbolic links for the input dir.

traverseDirectory :: (s -> RawFilePath -> IO s) -> s -> RawFilePath -> IO s Source #

Recursively apply the action to the parent directory and all files/subdirectories.

This function allows for memory-efficient traversals.

Follows symbolic links for the input dir.

readDirEnt :: DirStream -> IO (DirType, RawFilePath) Source #

packDirStream :: Ptr CDir -> DirStream Source #

unpackDirStream :: DirStream -> Ptr CDir Source #

fdOpendir :: Fd -> IO DirStream Source #

Binding to fdopendir(3).

realpath :: RawFilePath -> IO RawFilePath Source #

return the canonicalized absolute pathname

like canonicalizePath, but uses realpath(3)