directory-ospath-streaming-0.2.2: 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 ()
- data DirReadCache = DirReadCache (MutableByteArray# RealWorld)
- allocateDirReadCache :: IO DirReadCache
- releaseDirReadCache :: DirReadCache -> IO ()
- readRawDirStreamWithCache :: DirReadCache -> RawDirStream -> IO (Maybe (OsPath, Basename OsPath, FileType))

# Documentation

data RawDirStream Source #

Abstract handle to directory contents.

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

Constructors

RawDirStream !DirStream !OsPath |

openRawDirStream :: OsPath -> IO RawDirStream Source #

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

closeRawDirStream :: RawDirStream -> IO () Source #

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

data DirReadCache Source #

Constructors

DirReadCache (MutableByteArray# RealWorld) |

allocateDirReadCache :: IO DirReadCache Source #

releaseDirReadCache :: DirReadCache -> IO () Source #

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