fixps: a fatal bug, with a fix

Arnold Boothroyd <[email protected]> Fri, 27 Oct 2006 16:14:13 -0400 (EDT)
Newsgroups gmane.comp.printing.a2ps.bugs
Message-ID <[email protected]>
The  fixps 1.6 (GNU a2ps 4.13)  shell script (with Linux Fedora Core 5) 
can fail with an error message such as

mkdir: cannot create directory `/tmp/fixps.WP4474': File exists

This appears to be due to the fact that the command (near the beginning of 
fixps) creating the temporary directory with mktemp, namely:

   tmpdir=$(mktemp -d /tmp/$program.XXXXXX)

is followed (near the middle of fixps) by another command to created this 
temporary directory with mkdir, namely:

   mkdir $tmpdir

This bug appears to be fixed by adding a test for the existence of the 
temporary directory around this latter statement, converting it to:

   if ! ( test -d $tmpdir ) ; then
     mkdir $tmpdir
   fi

Best wishes,
    ---Arnold

-- 

Dr. Arnold I. Boothroyd
CITA, U. of Toronto          tel: (416) 978-5759
60 St. George Street         fax: (416) 978-3921
Toronto, Ontario          E-mail: [email protected]
Canada  M5S 3H8              WWW: http://www.cita.utoronto.ca/~boothroy/