digitalmars.D.learn - [beginner] Why nothing is printed to stdout ?
- =?iso-8859-1?b?RnLpZOlyaWM=?= Galusik (18/18) Oct 30 2011 Hi,
- simendsjo (8/25) Oct 30 2011 Works for me on 2.055 and 2.056 on windows. What compiler and OS are you...
- =?iso-8859-1?b?RnLpZOlyaWM=?= Galusik (3/11) Oct 30 2011 Tested with dmd 2.055 and now 2.056 on Linux
- Jesse Phillips (2/23) Oct 30 2011 works for me, dmd 2.054 linux.
- Nick Sabalausky (5/22) Oct 30 2011 My aplogies it you already know this, It's not my intention to be
- Mike James (4/31) Oct 30 2011 And you did run it in a DOS window or from a batch file with a PAUSE to
- =?iso-8859-1?b?RnLpZOlyaWM=?= Galusik (10/37) Oct 31 2011 Don't need to apologize, it's already kind to answer ;)
- Dmitry Olshansky (11/28) Oct 30 2011 I might be way off on this.
- =?iso-8859-1?b?RnLpZOlyaWM=?= Galusik (5/37) Oct 31 2011 Ohhh yesss, you got it.
- Steven Schveighoffer (13/49) Oct 31 2011 m
- Kagamin (2/10) Nov 01 2011 Huh, must port windows console to linux ^_^
- Jonathan M Davis (3/15) Nov 01 2011 No. No. We must port Windows users to Linux. ;)
- Jude Young (2/13) Nov 01 2011
- Graham Fawcett (5/18) Nov 01 2011 Too much work! Just put
- =?iso-8859-1?b?RnLpZOlyaWM=?= Galusik (3/26) Nov 01 2011 Excellent :D
- Jonathan M Davis (6/25) Nov 01 2011 Though if you don't get used to putting ./ in front of the names of bina...
- Graham Fawcett (8/33) Nov 01 2011 Agreed; if you're going to use a system, learn how to use it properly.
- Kagamin (2/6) Nov 02 2011 Seems like ./ tries to fix some sort of Namespace Pollution Hell when vi...
- Nick Sabalausky (10/19) Nov 02 2011 It's also a safety/security matter. Imagine:
- Kagamin (2/16) Nov 03 2011 It's ok to have a limited set of "keyword-class" tools in global namespa...
- Steven Schveighoffer (7/24) Nov 02 2011 That's a cool trick :)
- Graham Fawcett (8/38) Nov 02 2011 I can't speak for all shells, but bash and zsh don't expand aliases when...
- Nick Sabalausky (4/16) Nov 02 2011 The delicious irony is that if they had decided to use test instad of []...
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
Oct 30 2011
On 30.10.2011 11:00, Frédéric Galusik wrote: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.dWorks for me on 2.055 and 2.056 on windows. What compiler and OS are you using? c:\temp>dmd -w test.d c:\temp>test|more .\.a.d.un~ 5326 .\.asciidoc_user-guide.txt.un~ 942 (...)
Oct 30 2011
Le Sun, 30 Oct 2011 12:17:24 +0100, simendsjo a écrit :Works for me on 2.055 and 2.056 on windows. What compiler and OS are you using? c:\temp>dmd -w test.d c:\temp>test|more .\.a.d.un~ 5326 .\.asciidoc_user-guide.txt.un~ 942 (...)Tested with dmd 2.055 and now 2.056 on Linux ++
Oct 30 2011
On Sun, 30 Oct 2011 10:00:21 +0000, Frédéric Galusik wrote: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.dworks for me, dmd 2.054 linux.
Oct 30 2011
"Frédéric Galusik" <fredg salixosnospam.org> wrote in message news:j8j77l$pfv$1 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.dMy 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?
Oct 30 2011
"Nick Sabalausky" <a a.a> wrote in message news:j8kd11$25v1$1 digitalmars.com..."Frédéric Galusik" <fredg salixosnospam.org> wrote in message news:j8j77l$pfv$1 digitalmars.com...And you did run it in a DOS window or from a batch file with a PAUSE to allow you to read the output ;-)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.dMy 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?
Oct 30 2011
Le Sun, 30 Oct 2011 16:44:20 -0400, Nick Sabalausky a écrit :"Frédéric Galusik" <fredg salixosnospam.org> wrote in message news:j8j77l$pfv$1 digitalmars.com...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. ++ fredgHi, 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.dMy 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?
Oct 31 2011
On 30.10.2011 14:00, Frédéric Galusik wrote: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.dI might be way off on this. Yet this silly stuff used to catch me all the time when switching from windows to *nixes, back and forth: sh$: compile something to 'test' sh$: test no output - WTF? Ahem, it just called that command line tool named test... sh$: ./test wow, now something happens ;) -- Dmitry Olshansky
Oct 30 2011
Le Mon, 31 Oct 2011 00:55:58 +0400, Dmitry Olshansky a écrit :On 30.10.2011 14:00, Frédéric Galusik wrote:Ohhh yesss, you got it. That was so stupid, a big thanks. Regards. ++ fredgHi, 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.dI might be way off on this. Yet this silly stuff used to catch me all the time when switching from windows to *nixes, back and forth: sh$: compile something to 'test' sh$: test no output - WTF? Ahem, it just called that command line tool named test... sh$: ./test wow, now something happens ;)
Oct 31 2011
On Mon, 31 Oct 2011 06:01:05 -0400, Fr=C3=A9d=C3=A9ric Galusik = <fredg salixosnospam.org> wrote:Le Mon, 31 Oct 2011 00:55:58 +0400, Dmitry Olshansky a =C3=A9crit :mOn 30.10.2011 14:00, Fr=C3=A9d=C3=A9ric Galusik wrote: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.dI might be way off on this. Yet this silly stuff used to catch me all the time when switching fro=Oh I remember doing that too :) Don't feel bad, everyone does this at = least once. I hate that stupid test builtin, nobody ever uses it anymor= e. Note, it's not a command line tool, it's a shell builtin, which is why i= t = overrides anything in your search path. I've since adopted the habit of calling test programs "testme" instead o= f = "test" :) -Stevewindows to *nixes, back and forth: sh$: compile something to 'test' sh$: test no output - WTF? Ahem, it just called that command line tool named test... sh$: ./test wow, now something happens ;)Ohhh yesss, you got it. That was so stupid, a big thanks. Regards.
Oct 31 2011
Steven Schveighoffer Wrote:Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore. Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path. I've since adopted the habit of calling test programs "testme" instead of "test" :)Huh, must port windows console to linux ^_^
Nov 01 2011
On Tuesday, November 01, 2011 04:27 Kagamin wrote:Steven Schveighoffer Wrote:No. No. We must port Windows users to Linux. ;) - Jonathan M DavisOh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore. Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path. I've since adopted the habit of calling test programs "testme" instead of "test" :)Huh, must port windows console to linux ^_^
Nov 01 2011
Ew. speak no blasphemy... On Tue, Nov 1, 2011 at 6:27 AM, Kagamin <spam here.lot> wrote:Steven Schveighoffer Wrote:Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses itanymore.Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path. I've since adopted the habit of calling test programs "testme" instead of "test" :)Huh, must port windows console to linux ^_^
Nov 01 2011
On Tue, 01 Nov 2011 07:27:44 -0400, Kagamin wrote:Steven Schveighoffer Wrote:Too much work! Just put alias test='./test' in your .profile, and be happy. :) GrahamOh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore. Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path. I've since adopted the habit of calling test programs "testme" instead of "test" :)Huh, must port windows console to linux ^_^
Nov 01 2011
Le Tue, 01 Nov 2011 18:23:52 +0000, Graham Fawcett a écrit :On Tue, 01 Nov 2011 07:27:44 -0400, Kagamin wrote:Excellent :D ++Steven Schveighoffer Wrote:Too much work! Just put alias test='./test' in your .profile, and be happy. :) GrahamOh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore. Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path. I've since adopted the habit of calling test programs "testme" instead of "test" :)Huh, must port windows console to linux ^_^
Nov 01 2011
On Tuesday, November 01, 2011 18:23:52 Graham Fawcett wrote:On Tue, 01 Nov 2011 07:27:44 -0400, Kagamin wrote:Though if you don't get used to putting ./ in front of the names of binaries that you're running in the current directory, you're going to have other problems. The suggestion does fix the occasional screw-up with that particular command though. - Jonathan M DavisSteven Schveighoffer Wrote:Too much work! Just put alias test='./test' in your .profile, and be happy. :)Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore. Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path. I've since adopted the habit of calling test programs "testme" instead of "test" :)Huh, must port windows console to linux ^_^
Nov 01 2011
On Tue, 01 Nov 2011 12:18:02 -0700, Jonathan M Davis wrote:On Tuesday, November 01, 2011 18:23:52 Graham Fawcett wrote:Agreed; if you're going to use a system, learn how to use it properly. Then again, there's no shame in using "training wheels" if you're an absolute beginner. When I started using Unix, I was glad that the "dir" command was available on the system I was using. (I'm not sure if it was a binary, or whether a kindly sysop had provided an alias to "ls" for us Windows users). Learning is a journey of many small steps! GrahamOn Tue, 01 Nov 2011 07:27:44 -0400, Kagamin wrote:Though if you don't get used to putting ./ in front of the names of binaries that you're running in the current directory, you're going to have other problems. The suggestion does fix the occasional screw-up with that particular command though.Steven Schveighoffer Wrote:Too much work! Just put alias test='./test' in your .profile, and be happy. :)Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore. Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path. I've since adopted the habit of calling test programs "testme" instead of "test" :)Huh, must port windows console to linux ^_^
Nov 01 2011
Jonathan M Davis Wrote:Though if you don't get used to putting ./ in front of the names of binaries that you're running in the current directory, you're going to have other problems. The suggestion does fix the occasional screw-up with that particular command though.Seems like ./ tries to fix some sort of Namespace Pollution Hell when virtually every installed program ends up in path.
Nov 02 2011
"Kagamin" <spam here.lot> wrote in message news:j8rlig$145l$1 digitalmars.com...Jonathan M Davis Wrote:It's also a safety/security matter. Imagine: $ cat ./ls rm ~ -rf Gee, let's see what's inside this directory...WTF? God dammit!! Windows generally gets away without such problems because even the power users usually stick to the GUI for most stuff, and also because extensive shell scripting is generally avoided.Though if you don't get used to putting ./ in front of the names of binaries that you're running in the current directory, you're going to have other problems. The suggestion does fix the occasional screw-up with that particular command though.Seems like ./ tries to fix some sort of Namespace Pollution Hell when virtually every installed program ends up in path.
Nov 02 2011
Nick Sabalausky Wrote:It's ok to have a limited set of "keyword-class" tools in global namespace, but not every installed program. For example, on windows you don't have firefox or git or dmd in path (by default). You don't run dmd in arbitrary directory just to see what it will do.Seems like ./ tries to fix some sort of Namespace Pollution Hell when virtually every installed program ends up in path.It's also a safety/security matter. Imagine: $ cat ./ls rm ~ -rf Gee, let's see what's inside this directory...WTF? God dammit!! Windows generally gets away without such problems because even the power users usually stick to the GUI for most stuff, and also because extensive shell scripting is generally avoided.
Nov 03 2011
On Tue, 01 Nov 2011 14:23:52 -0400, Graham Fawcett <fawcett uwindsor.ca> wrote:On Tue, 01 Nov 2011 07:27:44 -0400, Kagamin wrote:That's a cool trick :) However, one issue, if you do happen to run any shell scripts where some a**hole insisted on using test instead of the [] form, this will cause problems. There must be some way to check for an interactive shell... -SteveSteven Schveighoffer Wrote:Too much work! Just put alias test='./test' in your .profile, and be happy. :)Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore. Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path. I've since adopted the habit of calling test programs "testme" instead of "test" :)Huh, must port windows console to linux ^_^
Nov 02 2011
On Wed, 02 Nov 2011 07:56:19 -0400, Steven Schveighoffer wrote:On Tue, 01 Nov 2011 14:23:52 -0400, Graham Fawcett <fawcett uwindsor.ca> wrote:I can't speak for all shells, but bash and zsh don't expand aliases when you run a script. From the bash manual: Aliases are not expanded when the shell is not interactive, unless the expand_aliases shell option is set using shopt (see the description of shopt under SHELL BUILTIN COMMANDS below). Cheers, GrahamOn Tue, 01 Nov 2011 07:27:44 -0400, Kagamin wrote:That's a cool trick :) However, one issue, if you do happen to run any shell scripts where some a**hole insisted on using test instead of the [] form, this will cause problems. There must be some way to check for an interactive shell...Steven Schveighoffer Wrote:Too much work! Just put alias test='./test' in your .profile, and be happy. :)Oh I remember doing that too :) Don't feel bad, everyone does this at least once. I hate that stupid test builtin, nobody ever uses it anymore. Note, it's not a command line tool, it's a shell builtin, which is why it overrides anything in your search path. I've since adopted the habit of calling test programs "testme" instead of "test" :)Huh, must port windows console to linux ^_^
Nov 02 2011
"Steven Schveighoffer" <schveiguy yahoo.com> wrote in message news:op.v4bh35eaeav7ka localhost.localdomain...On Tue, 01 Nov 2011 14:23:52 -0400, Graham Fawcett <fawcett uwindsor.ca> wrote:The delicious irony is that if they had decided to use test instad of [], it was probably for the sake of maximizing compatibility.Too much work! Just put alias test='./test' in your .profile, and be happy. :)That's a cool trick :) However, one issue, if you do happen to run any shell scripts where some a**hole insisted on using test instead of the [] form, this will cause problems. There must be some way to check for an interactive shell...
Nov 02 2011