Rewinding std::cout to go back to the beginning of a line

Posted by fbrereto on Stack Overflow See other posts from Stack Overflow or by fbrereto
Published on 2010-06-16T23:46:10Z Indexed on 2010/06/16 23:52 UTC
Read the original article Hit count: 275

I'm writing a command-line tool for Mac OS X that processes a bunch of files. I would like to show the user the current file being processed, but do not want a bazillion files polluting the terminal window.

Instead I would like to use a single line to output the file path, then reuse that line for the next file. Is there a character (or some other code) to output to std::cout to accomplish this?

Also, if I wanted to re-target this tool for Windows, would the solution be the same for both platforms?

© Stack Overflow or respective owner

Related posts about c++

Related posts about macosx