Chris,

add an extra \n at the end of the line or the buffering will be non
coherent between the platforms.


On Fri, Dec 06, 2002, Chris Pine wrote:
> Quick question:
> 
> Why do I have to put
> 
>   $stdout.sync = true
> 
> in my programs if I run them in Windows (it's XP, if that matters), but not
> in Linux?  Here's the program (it's for my tutorial):
> 
>   puts ('Hello, and what is your name?')
>   name = gets.chomp
>   puts (name+'?  What a lovely name!')
>   puts ('Pleased to meet you, '+name+'.  :)')
> 
> In Linux, it works like you'd expect, but in Windows (unless I set
> $stdout.sync = true), it doesn't print the first line until the end.  So the
> program looks like it's hanging when it's waiting for the 'gets' to finish.
> 
> Is this on purpose?  I'd rather not have to introduce '$stdout.sync = true'
> right now.  It seems like 'true' should be the default setting, anyway...
> doesn't it?
> 
> Chris
> 
> 

-- 
Pierre Baillet
Fight For your rights - http://www.fsf.org/philosophy/no-word-attachments.html