Abstract handle to directory contents.
May be closed multiple times and will be automatically closed by GC when it goes out of scope.
Constructors
DirStreamdsHandle :: !RawDirStreamdsIsClosed :: !CounterdsFin :: !Weak DirStream
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Moduledirectory-ospath-streaming-0.3Haskell2010
Abstract handle to directory contents.
May be closed multiple times and will be automatically closed by GC when it goes out of scope.
DirStreamdsHandle :: !RawDirStreamdsIsClosed :: !CounterdsFin :: !Weak DirStreamReturns basename path of the directory entry.
Returns both basename path and full path of a directory entry relative to the passed DirStream root.
For example:
readDirStreamFull =<< openDirStream [osp|.|]
Just ("./bar",Basename {unBasename = "foo"},File Regular)readDirStreamFull =<< openDirStream [osp|foo/|]
Just ("foo/bar",Basename {unBasename = "foo"},File Regular)readDirStreamFull =<< openDirStream [osp|/foo/foo|]
Just ("/foo/foo/bar",Basename {unBasename = "foo"},File Regular)This allows to avoid re-creating the full path on the client side and thus reduce allocations.
Deallocate directory handle. It’s safe to close DirStream multiple times, unlike the underlying OS-specific directory stream handle.