[beginner] Why nothing is printed to stdout ?

Frédéric Galusik fredg at salixosnospam.org
Mon Oct 31 02:58:12 PDT 2011


Le Sun, 30 Oct 2011 16:44:20 -0400, Nick Sabalausky a écrit :

> "Frédéric Galusik" <fredg at salixosnospam.org> wrote in message
> news:j8j77l$pfv$1 at digitalmars.com...
>> Hi,
>>
>> Can someone give me a clue on why nothing is printed to stdout ?
>>
>> I wish a list of files with their size.
>>
>> code:
>> //
>> import std.stdio;
>> import std.file;
>>
>> void main(string[] args)
>> {
>>    foreach (DirEntry e; dirEntries(".", SpanMode.shallow)) {
>>        writeln(e.name, "\t", e.size);
>>    }
>> }
>> //
>> Build with (dmd2):
>> dmd -w test.d
>>
>>
> My aplogies it you already know this, It's not my intention to be
> patronizing: You did run the resulting executable, right ( ./test )? And
> there are files in the dir its beng run from?

Don't need to apologize, it's already kind to answer ;)
So, Yes I run the resulting executable in my $HOME dir where there are 
many files.

If I run it through Geany (IDE) I only got:
------------------
(program exited with code: 1)
Press return to continue

If I run in my terminal, there's no output.

++ fredg


More information about the Digitalmars-d-learn mailing list