[tex-live] Re: [pdftex] Fwd: [OS X TeX] "Too many open files" error - how to fix?

Gerben Wierda Sherlock@rna.nl
Fri, 6 Sep 2002 14:37:19 +0200


On Friday, September 6, 2002, at 11:40 , Fabrice Popineau wrote:

>> Is this a known possible problem? Have the source and/or
>> source.development directories of TeX Live been updated since the
>> release of TeX Live 7?
>
> Known problem due to an 'optimisation' added in pdftex at some
> point. I have removed it for the win32 version.
>
> // Called when an image has been written and it's resources in
> // image_tab are freed.  We cannot deallocate the PdfDocument yet, as
> // future pages of the same document may be embedded. As an
> // optimization, we do delete it if it's a one-page document.
> void epdf_delete()
> {
>
>     // Akira Kakuto has suggested to make epdf_delete empty, so
> #if 1
>     PdfDocument *pdf_doc = (PdfDocument *) epdf_doc;
>     xref = pdf_doc->xref;
>     if (pdf_doc->doc->getCatalog()->getNumPages() == 1)
> 	delete_document(pdf_doc);
> #endif
> }
>
> Change the '#if 0' to '#if 1' or remove the matchine #if/#endif pair.

Given that this optimization results in a broken pdfTeX (some artificial 
limit on the number of pdf images you can include), I would suggest 
making this optimization not default.

G