I'm trying to read a large file (about 1.5M) with information to be processed, but it always ends prematurely with either \input or a loop with \read. The file is correctly balanced (believe me) and by removing parts of it the file ends at different points, even in the middle of a macro name (with the corresponding error of undefined macro), which, of course, is complete in the source. So the problem is TeX itself (TeX Live 2010). I presume there should be a parameter setting a limit, but after reading the documentation I could find nothing. The program has nothing special except a lot of \pdfsavepos. Is there a parameter in TeX Live to change the file size limit or is there a known bug?
More on the error
The code is:
\begingroup
\makeatletter
\@tempswatrue
\loop
\ifeof\ulp@in\@tempswafalse\fi
\if@tempswa
\read\ulp@in to\@tempa
\@tempa
\repeat
\endgroup
When the following part is read:
\ulp@Ga{24}\@ne {%
\ulp@Pa{1}{13349836}{12624364}{0}%
\ulp@Pa{2}{14554971}{12624364}{1}%
\ulp@Pa{3}{14739040}{12624364}{1}%
\ulp@Pa{4}{16705126}{12624364}{1}%
\ulp@Pa{5}{16889195}{12624364}{1}%
\ulp@Pa{6}{18218124}{12624364}{1}%
\ulp@Pa{7}{7030046}{11837932}{1}%
\ulp@Pa{8}{8943337}{11837932}{0}%
}%
the file is prematurely ended, as shown in the log file:
\@tempa ->\ulp@Ga {24}\@ne {\ulp@Pa {1}{13349836}{12624364}{0}\ulp@Pa {2}{14554971}{12624364}{1}\ulp@Pa {3}{14739040}{12624364}{1}\ulp@Pa {4}{16705126}{12624364}{1}\ulp@Pa {5}{16889195}{64}{1}\ulp@Pa {5}{16889195}{
Note \read has not read correctly the file, and the last argument of \ulp@Ga is incomplete (the last thing is {). Before this point, all \ulp@Gas are read correctly (some of them are even longer).
\read). – Javier Bezos Aug 2 '11 at 15:42