Search code examples
ats

How to flush stdout in ATS


I am trying to do animation in the terminal by printing and flushing repeatedly. Is there a way to flush the standard output after writing to it in ATS?

Thank you!


Solution

  • I suppose that you can just do

    val () = fileref_flush(stdout_ref)
    

    If you need to do this all the time, then you may want to use 'setbuf' to disable buffering.