# Force output during long process

**URL:** <https://www.ruby-forum.com/t/force-output-during-long-process/113987>\
**Category:** Ruby\
**Created:** [September 6, 2007, 10:06pm UTC](https://www.ruby-forum.com/t/force-output-during-long-process/113987 "2007-09-06T22:06:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwv549](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ac8455/32.png) [@bwv549](https://www.ruby-forum.com/u/bwv549)\
**Post date:** [September 6, 2007, 10:06pm UTC](https://www.ruby-forum.com/t/force-output-during-long-process/113987/1 "2007-09-06T22:06:12Z")

</div>

I’m running a long process and need to give some feedback to the user  
(command line program). Is there some way to force output at a given  
step of execution? Many times it seems that the output is spooled and  
then printed to the screen all at once.

e.g.:

# … inside some\_very\_long\_program

puts “working…” # needs to display here and not spool it until  
later

Thanks

---

<div class="post-metadata">

**Author:** ![bwv549](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ac8455/32.png) [@bwv549](https://www.ruby-forum.com/u/bwv549)\
**Post date:** [September 6, 2007, 10:56pm UTC](https://www.ruby-forum.com/t/force-output-during-long-process/113987/2 "2007-09-06T22:56:22Z")

</div>

On Sep 6, 2:00 pm, bwv549 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks

To flush the buffer, use $stdout.flush  
To not use a buffer at all, use $stdout.sync = true

HTH,  
Chris
