InvalidMemoryOperationError from File.byLine()?

Stiff via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 2 12:18:13 PDT 2015


Hi,

I'm reading in a rather large text file (~25Mb) line by line, 
where I don't need to hang on to a line for more than one 
iteration through my loop. I'm consistently getting an 
InvalidMemoryOperationError on my 2,547th iteration, and based on 
console outputs, I'm fairly certain it's coming from the byLine() 
method. To be clear, I'm just doing a simple:

foreach (line; file.byLine()){ ... }

Am I possibly screwing something up? I haven't declared any 
classes or written any destructors. Is this a bug? If so, is 
there a workaround?

Thanks!


More information about the Digitalmars-d-learn mailing list