nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6ca345
)
windows: flush after each write
author
Alexis Laferrière
<alexis.laf@xymus.net>
Wed, 22 Feb 2017 19:53:32 +0000
(11:53 -0800)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Thu, 23 Feb 2017 14:00:02 +0000
(09:00 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/core/file.nit
patch
|
blob
|
history
diff --git
a/lib/core/file.nit
b/lib/core/file.nit
index
baa3403
..
6701588
100644
(file)
--- a/
lib/core/file.nit
+++ b/
lib/core/file.nit
@@
-1509,7
+1509,12
@@
private extern class NativeFile `{ FILE* `}
`}
fun io_write(buf: CString, from, len: Int): Int `{
- return fwrite(buf+from, 1, len, self);
+ size_t res = fwrite(buf+from, 1, len, self);
+#ifdef _WIN32
+ // Force flushing buffer because end of line does not trigger a flush
+ fflush(self);
+#endif
+ return (long)res;
`}
fun write_byte(value: Byte): Int `{