writeln if not empty

monarch_dodra monarchdodra at gmail.com
Tue Mar 11 14:10:13 PDT 2014


On Tuesday, 11 March 2014 at 05:37:25 UTC, Timothee Cour wrote:
> Thanks,
> that indeed works in many cases but there are still others (eg 
> what if
> empty() prints, say in debug mode: writelnIfNotEmpty would not 
> print the
> debug information even though writeln() would execute that 
> debug code and
> print something).
>
> I was wondering whether there would be a robust way that would 
> check
> whether anything was written to stdout (eg via accessing raw 
> file pointer/C
> lib)

I have no idea how you could intercept such information. At 
least, not with "standard D". You'd (probably) have to, as you 
said, have to dig up C's stdlib.


More information about the Digitalmars-d-learn mailing list