From: Robert Klemme Date: 2009-10-07T15:10:06+09:00 Subject: Re: How to not display output of a system call. On 07.10.2009 04:58, 7stud -- wrote: > Jerry Piazza wrote: >> I am now trying to impliment this. >> >> I created this: >> def spinner spin_trigger >> while (spin_trigger == true) Comparing with "true" or "false" to obtain a boolean value is a very bad idea - especially in Ruby which has two false values and unlimited true values. >> print "\\\r" >> sleep 1 >> print "|\r" >> sleep 1 >> print "/\r" >> sleep 1 >> print "-\r" >> sleep 1 >> end >> end >> >> spin = true >> Thread.new do >> spinner spin >> end >> files = Dir.glob("c:/**/*.txt") >> spin = false >> >> But all I get is a "\" stuck at the beginning of the line until the Dir >> command finishes. >> >> Maybe I am confused about the usage of Thread? > > I think you have some more basic issues to deal with first. What do you > think the output of the following code will be: > > def test(x) > while x == 20 > sleep 3 > puts x > end > end > > x = 10 > test(20) > x = 30 Absolutely! robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/