Skip to content

Commit

Permalink
Enable listDirChunked for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
harendra-kumar committed Nov 17, 2024
1 parent 4564699 commit 03a5699
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 03a5699

Please sign in to comment.