Yes, you are 100% right, it does create a sparse file. I must have not run
du or not at the right moment in the past. I also normally truncate first but it did not always seem to have the desired effect in the past. I tested it now on both Red Hat Linux and Solaris 10 and although
ls -l showed an ever growing file, it uses little actual space. It is also logical it happens this way..
On Solaris I sometimes seemed to have to truncate several times before it showed a lower disk usage. Might be a just a delay, maybe that is why it did not seem to work in the past.
When redirecting Bourne Shell on Solaris, there was no difference between writing and appending. In other shells the file became really 0 bytes in size when appending.. .
I do wonder if writing applications will never be bothered by such a file..
Anyway this is very good and useful information, and good insight.. thanks