On 20.10.2006 23:40, Julián Rodríguez Bajo wrote:
lsof reports that /var/log/messages is opened just once by process syslog/syslog-ng, but .xsession-errors is opened by a lot of KDE processes (kio_*, start_kde, kdeinit, dcopserver...)
Also, as you say, the begining of the file are just a lot of 0x00 (32945 0x00 bytes on my system right now) followed by normal text messages.
Indeed. Did some experimenting with the help of good old stdio.h The 0x00s in the begining of the file are actually the hole in a "file with holes" that can be created on some file systems. These are created when a programme writes to a position in the file outside its current size. Now flushing an opened file with cat /dev/null > file works excellent on files opened in append mode (fopen("file", "a")), but result in file holes when the file is opened in write mode. What troubles me here is why .xsession-errors is not opened in append mode? -- Blade hails you... Deep dark is His Majesty's kingdom A portent of tomorrow's world There shall the liquid give Him power The red-eyed unborn lord --Nightwish