Once again, thanks Gaby and Benjamin for your precious advice, in particular about attached with a TTY being a dynamic property and the suggestion to look at _M_buf_size_opt. To date my knowledge of iostreams is still quite limited, but I'll try to follow your suggestions to my best in the next few days. Ciao, Paolo.