On 25 October 2012 16:17, Joseph Rushton Wakeling <joseph.wakel...@webdrake.net> wrote: > Hello all, > > I have some code which needs to read in data from a large number of files in > a directory. > > The basic data input code goes something like this: > > foreach(DirEntry e; dirEntries(...)) > { > auto f = file(e.name, "r"); > // we input data from f. > } > > This runs fine with ldc and dmd. However, if I compile with gdc (4.6.3) I > get the following error while running the program: > > ------------------------------------------------------------------------------ > std.exception.ErrnoException@../../../src/libphobos/std/stdio.d(330): Cannot > open file in mode `r' (Too many open files) > ------------------------------------------------------------------------------ > > This is trivial to work around by putting an explicit f.close() at the end > of the loop, but it looks like a bug to me as f should in any case > automatically be closed at the end of the scope -- no? > > I don't see a bug report on BitBucket about this, but thought I'd check here > first in case this is something that has already been fixed in the latest > version. >
Don't raise a bug in bitbucket, it'll only be ignored... -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';