Dear GAP Forum,
Nathan Dunfield raised a problem with repeated calls to Process(), after
creating a temporary directory.
This is a bug in GAP, and will be fixed in version 4.2, which will be released
very shortly. In the meantime, the problem can be avoided by creating the
temporary directory yourself, rather than calling DirectoryTemporary(), or
with a patch which we can provide to anyone who needs it (contact
The problem arose because the kernel routine in GAP 4.1 which assigns
filenames runs through a pool of just 10000 names before repeating them, while
the library method for calling Process with non file streams uses up two
temporary names each time it is called. As a result, the 5000th call
encountered the name that was already in use for the temporary directory and
caused the error that you saw.
In GAP 4.2, both the kernel and the library behaviour have been improved. The
kernel function should now never repeat a name (unless system limits on file
name length are encountered), while the library method acquires two temporary
file names the first time they are needed, and then re-uses them, unless some
other process creates them in the meantime.