[pdftex] BUG pdftex-1.40.11 TeXLive 2010 (win32)

Akira Kakuto kakuto at fuk.kindai.ac.jp
Mon Apr 11 15:38:49 CEST 2011


Hi Heiko,

> Test file for use with "pdfTeX -ini":
> 
> \catcode`\{=1
> \catcode`\}=2
> \catcode`\#=6
> \pdfoutput=1
> \def\msg#{\immediate\write16}
> \def\test#1{%
>   \edef\x{\pdfmdfivesum file{#1}}%
>   \msg{[\x] #1}%
> }
> \test{ctanlion.png}
> \test{tiger.pdf}
> 
> \pdfximage {ctanlion.png}
> \test{ctanlion.png}
> \test{tiger.pdf}
> 
> \pdfximage {tiger.pdf}
> \test{ctanlion.png}
> \test{tiger.pdf}
> 
> \csname @@end\endcsname\end

Thanks. I found the relevant code for the issue in xpdf.
I can modify PDFDoc.cc in xpdf to obtain the right md5 sum
after \pdfximage:

#ifdef WIN32
  {
    /* block other processes from messing with the file */
    long len;
    fseek (file, 0L, SEEK_END);
    len = ftell (file);
    fseek (file, 0L, SEEK_SET);
    if(_locking(_fileno(file), _LK_NBLCK, len)) {
      fclose(file);
      error(-1, "Couldn't lock file '%s'", fileName->getCString());
      errCode = errOpenFile;
      return;
    }
  }
#endif

 ----->

#if 0
#ifdef WIN32
  {
    /* block other processes from messing with the file */
    long len;
    fseek (file, 0L, SEEK_END);
    len = ftell (file);
    fseek (file, 0L, SEEK_SET);
    if(_locking(_fileno(file), _LK_NBLCK, len)) {
      fclose(file);
      error(-1, "Couldn't lock file '%s'", fileName->getCString());
      errCode = errOpenFile;
      return;
    }
  }
#endif
#endif

etc.

Should I change PDFDoc.cc as above?

Thanks,
Akira




More information about the pdftex mailing list