on master help sign in
use RawIO.write because it works for windows as well

FDIO.writeAll does not work for windows.

commitd0bf5593d2b5b0e1572592da0ff8d5cf62b091e8 authorHarendra Kumar <harendra.kumar@gmail.com> dateMon 17 Jun 2019, 21:06 (7 years ago) parent6688d0e
1 file changed+4−3
src/Streamly/FileSystem/FD.hs+4−3
src/Streamly/FileSystem/FD.hs+4−3
@@ -134,8 +134,8 @@ import System.IO (IOMode)
134134import Prelude hiding (read)
135135
136136import qualified GHC.IO.FD as FD
137−import qualified GHC.IO.Device as RawIO hiding (write)
138−import qualified Streamly.FileSystem.FDIO as RawIO
137+import qualified GHC.IO.Device as RawIO
138+import qualified Streamly.FileSystem.FDIO as RawIO hiding (write)
139139
140140import Streamly.Mem.Array.Types (Array(..))
141141import Streamly.Streams.Serial (SerialT)
@@ -242,7 +242,8 @@ readArrayUpto size (Handle fd) = do
242242writeArray :: Storable a => Handle -> Array a -> IO ()
243243writeArray _ arr | A.length arr == 0 = return ()
244244writeArray (Handle fd) arr = withForeignPtr (aStart arr) $ \p -> do
245− RawIO.writeAll fd (castPtr p) aLen
245+ -- RawIO.writeAll fd (castPtr p) aLen
246+ RawIO.write fd (castPtr p) aLen
246247 {-
247248 -- Experiment to compare "writev" based IO with "write" based IO.
248249 iov <- A.newArray 1