System.Directory.OsPath.Streaming.Internal.Raw

directory-ospath-streaming-0.2.1: Stream directory entries in constant memory in vanilla IO

Copyright | (c) Sergey Vinokurov 2024
License | Apache-2.0 (see LICENSE)
Maintainer | serg.foo@gmail.com
Safe Haskell | None
Language | Haskell2010

System.Directory.OsPath.Streaming.Internal.Raw

Description

Streaming functions for interacting with the filesystem.

These do the basic job of reading directory entries but care must be taken to not close these streams more than once.

Synopsis

- data RawDirStream = RawDirStream !DirStream !OsPath
- openRawDirStream :: OsPath -> IO RawDirStream
- readRawDirStream :: RawDirStream -> IO (Maybe (OsPath, FileType))
- closeRawDirStream :: RawDirStream -> IO ()
- newtype DirReadCache = DirReadCache ()
- allocateDirReadCache :: IO DirReadCache
- releaseDirReadCache :: DirReadCache -> IO ()
- readRawDirStreamWithCache :: DirReadCache -> RawDirStream -> IO (Maybe (OsPath, Basename OsPath, FileType))

# Documentation

data RawDirStream #

Abstract handle to directory contents.

Not thread safe and shouldn't be closed more than once.

Constructors

RawDirStream !DirStream !OsPath |

openRawDirStream :: OsPath -> IO RawDirStream #

readRawDirStream :: RawDirStream -> IO (Maybe (OsPath, FileType)) #

closeRawDirStream :: RawDirStream -> IO () #

Deallocate directory handle. It’s not safe to call multiple times on the same handle.

newtype DirReadCache #

Constructors

DirReadCache () |

allocateDirReadCache :: IO DirReadCache #

releaseDirReadCache :: DirReadCache -> IO () #

readRawDirStreamWithCache :: DirReadCache -> RawDirStream -> IO (Maybe (OsPath, Basename OsPath, FileType)) #