Re: readln() blocks file operations on windows

2014-08-05 Thread Inspi8 via Digitalmars-d
On Thursday, 31 July 2014 at 19:13:28 UTC, Martin Drasar via Digitalmars-d wrote: On 31.7.2014 20:37, FreeSlave via Digitalmars-d wrote: Note that output to stdout is not good choice to check event order, because it's buffered. Try to flush stdout or write to stderr. Maybe it's actual

readln() blocks file operations on windows

2014-07-31 Thread Martin Drasar via Digitalmars-d
Hi, consider this code: import std.stdio; import std.concurrency; import core.thread; void tryOpen() { Thread.sleep(2.seconds); try { auto f = File(nonexistent); } catch (Exception e) { writeln(Could not open a file); } } void main() { spawn(tryOpen); readln(); } On

Re: readln() blocks file operations on windows

2014-07-31 Thread FreeSlave via Digitalmars-d
Note that output to stdout is not good choice to check event order, because it's buffered. Try to flush stdout or write to stderr. Maybe it's actual problem.

Re: readln() blocks file operations on windows

2014-07-31 Thread Martin Drasar via Digitalmars-d
On 31.7.2014 20:37, FreeSlave via Digitalmars-d wrote: Note that output to stdout is not good choice to check event order, because it's buffered. Try to flush stdout or write to stderr. Maybe it's actual problem. Hi, this is just for illustration, although I think that writeln flushes itself.