On Sun, Dec 1, 2013 at 12:56 AM, Ole Tange <[email protected]> wrote: > Maybe it would be possible to append a byte to the tmp files before > printing them. If ftell stays the same then the append did not work > and a warning should be written. If it worked, seek back 1 byte and > truncate. This, however, might slow down printing of a job, and seems > like a lot of checking to do for each and every job for the off chance > that $TMPDIR is full.
I have now implemented this idea. A single byte was not enough. In my tests I had to use 8kbytes - maybe it has to be more than a file system block or a page frame? It costs 0.07 ms per job on my system: 1.97 ms -> 2.04 ms. So it clearly slows down printing, but I consider a 3% runtime increase of the smallest jobs acceptable. On big jobs the increase will still be 0.07 ms and thus less than a 3% increase. It will not catch every situation of disk full, but it will probably catch most real life situations. /Ole
