Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable listDirChunked for Windows #71

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/ListDir.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ import qualified Streamly.Data.Unfold as Unfold
import qualified Streamly.Internal.Data.Unfold as Unfold
(either, nil)
import qualified Streamly.Internal.FileSystem.DirIO as Dir
(readEitherPaths, eitherReaderPaths)
(readEitherChunks, readEitherPaths, eitherReaderPaths)
import qualified Streamly.FileSystem.Handle as Handle
import qualified Streamly.FileSystem.Path as Path
import qualified Streamly.Internal.FileSystem.Path as Path (toChunk)
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
import qualified Streamly.Internal.FileSystem.Posix.ReadDir as Dir
(readEitherChunks, readEitherByteChunks)
(readEitherByteChunks)
#endif

#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
Expand Down Expand Up @@ -95,6 +95,7 @@ listDirByteChunked = do

streamDirMaybe :: Either [Path] b -> Maybe (Stream IO (Either [Path] (Array Word8)))
streamDirMaybe = either (Just . Dir.readEitherByteChunks) (const Nothing)
#endif

-- Faster than the listDir implementation below
listDirChunked :: IO ()
Expand Down Expand Up @@ -138,7 +139,6 @@ listDirChunked = do

streamDirMaybe :: Either [Path] b -> Maybe (Stream IO (Either [Path] [Path]))
streamDirMaybe = either (Just . Dir.readEitherChunks) (const Nothing)
#endif

listDir :: IO ()
listDir = do
Expand Down Expand Up @@ -194,7 +194,7 @@ main :: IO ()
main = do
hSetBuffering stdout LineBuffering
listDir
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
-- listDirChunked
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
-- listDirByteChunked
#endif
1 change: 1 addition & 0 deletions streamly-examples.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ common exe-options
-Wincomplete-uni-patterns
-Wredundant-constraints
-Wnoncanonical-monad-instances
-Wno-deprecations
if impl(ghc >= 9.8)
ghc-options: -Wno-x-partial

Expand Down
Loading