[metapost] ! MetaPost capacity exceeded, sorry [readfrom files=30].

Ulrik Vieth ulrik.vieth at arcor.de
Sun Feb 3 19:42:33 CET 2008

Hi all,

I think it is very unlikely that you intentionally end up with
30 simulatenously open readfrom files. Most likely the problem
is caused because readform files stay open by accident if you
stop reading before you reach the end of the file.

Many years ago I ran into similar problems when I was using the
graph package reading many data files.  At that time i wrote
a small macro package "closefrm.mp" which implements a "closefrom"
macro that triggers file closing by reading to the end of file.
Of couse, this is a only hack, but it used to work.


I vaguely recall that John Hobby implemented a closefrom primitive
in a subsequent version of MetaPost (0.64 according to the changelog), 
but it is possible that the documentation is missing in the manual.

I think the best solution might be to add a few closefrom commands
in your metapost code, so that you don't actually need to increase
the limits of mp.ch.

Hope this helps.


Taco Hoekwater wrote:
> christophe.poulain at melusine.eu.org wrote:
>>how can I increase the readfrom files value ?
> Adjusting max_read_files in tex.ch is indeed the only way,
> but I am curious: how does one end up with 30 simultaenously
> open readfrom files?
> Best wishes,
> Taco
> --
> http://tug.org/metapost/

More information about the metapost mailing list