Bug#438205: race condition: kdeprint sometimes fails on printing jobs which are removed after kdeprint exits
i have a shellscript:
kprinter a0.pdf a1.pdf a2.pdf a3.pdf a4.pdf a5.pdf a6.pdf a7.pdf a8.pdf a9.pdf
rm a0.pdf a1.pdf a2.pdf a3.pdf a4.pdf a5.pdf a6.pdf a7.pdf a8.pdf a9.pdf
the user selects a cups printer in the dialog and prints the files.
normally this works. (did it about 30 times now)
and now suddenly a messagebox appeared:
do not find file "a0.pdf"
when i check the existence of a0.pdf i find that it is gone in the moment this
this means that kprinter exits BEFORE a0.pdf was read.
that is a race condition and IMHO should be fixed, because this kind of script
is not unusual. every temporary print job is printed like this, for example:
i am using some c++ program to create pdf stock report files and print them
by a user configurable program like "lpr" or "kprinter". when that user
configurable printing program exits, the c++ program immediately removes the
temporary pdfs from harddisk again of course. i really think this should work
reliably. otherwise one would have to arrange for a timer which deletes the
temporary files after 10 seconds - which in itself is again a race