From 1b52fa309bea7e08272d8075d881b7b424b686bf Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Sun, 17 Nov 2024 10:08:55 +0530 Subject: [PATCH] Enable listDirChunked for Windows --- examples/ListDir.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/ListDir.hs b/examples/ListDir.hs index b4d1cad..e35014a 100644 --- a/examples/ListDir.hs +++ b/examples/ListDir.hs @@ -46,9 +46,11 @@ import qualified Streamly.Internal.FileSystem.DirIO as Dir import qualified Streamly.FileSystem.Handle as Handle import qualified Streamly.FileSystem.Path as Path import qualified Streamly.Internal.FileSystem.Path as Path (toChunk) +import qualified Streamly.Internal.FileSystem.Posix.ReadDir as Dir + (readEitherChunks) #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__) @@ -95,6 +97,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 () @@ -138,7 +141,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 @@ -194,7 +196,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