Skip to content

Commit b795bf8

Browse files
Add some more debug messages
1 parent 7739c2c commit b795bf8

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • core/src/Streamly/Internal/FileSystem/Windows

core/src/Streamly/Internal/FileSystem/Windows/File.hsc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ failIfWithRetry needRetry msg action = retryOrFail retries
7070
then return ret
7171
else do
7272
err_code <- getLastError
73+
putStrLn $ "failed.........err_code " ++ show err_code
7374
if err_code == 32
7475
then do
76+
putStrLn "retrying......"
7577
threadDelay delay
7678
retryOrFail (times - 1)
7779
else errorWin msg
@@ -91,13 +93,13 @@ createFile ::
9193
-> IO Win32.HANDLE
9294
createFile name access share mb_attr mode flag mb_h =
9395
withFilePath name $ \ c_name -> do
94-
putStrLn $ "**pre createFile: fp [" ++ Path.toString name
96+
putStrLn $ "**pre createFile: fp [" ++ Path.toString name ++ "]"
9597
h <- failIfWithRetry
9698
(== iNVALID_HANDLE_VALUE)
9799
(unwords ["CreateFile", Path.toString name])
98100
$ c_CreateFile
99101
c_name access share (maybePtr mb_attr) mode flag (maybePtr mb_h)
100-
putStrLn $ "**post createFile: fp [" ++ Path.toString name
102+
putStrLn $ "**post createFile: fp [" ++ Path.toString name ++ "]"
101103
return h
102104

103105
{-
@@ -112,8 +114,10 @@ win2HsHandle _fp iomode h = do
112114
when (iomode == AppendMode )
113115
$ void $ Win32.setFilePointerEx h 0 Win32.fILE_END
114116
#if defined(__IO_MANAGER_WINIO__)
117+
putStrLn "win2HSHandle: IO Manager WINIO"
115118
Win32.hANDLEToHandle h
116119
#else
120+
putStrLn "win2HSHandle: NOT WINIO"
117121
fd <- _open_osfhandle (fromIntegral (ptrToIntPtr h)) (#const _O_BINARY)
118122
fdToHandle' fd Nothing False (Path.toString _fp) iomode True
119123
#endif

0 commit comments

Comments
 (0)