core.exception.InvalidMemoryOperationError@(0) on File Reading.

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 22 13:45:15 PDT 2015


On Monday, 22 June 2015 at 20:30:40 UTC, David DeWitt wrote:
> I am getting an core.exception.InvalidMemoryOperationError@(0)
>
>      auto recs = f  // Open for reading
>                            .byLineCopy();
>                            .array;  //Here is where is appears 
> to be happening.
>
> I have narrowed it down to the .array.  I am wondering if there 
> is some common issue I may be experiencing or if there is a 
> better solution?
>

You may be hitting issue 14005/14578 with the underlying issue 
13856.

https://issues.dlang.org/show_bug.cgi?id=14005
https://issues.dlang.org/show_bug.cgi?id=14578
https://issues.dlang.org/show_bug.cgi?id=13856

You can try using the current development version of phobos from 
git. I think the InvalidMemoryOperationError shouldn't happen 
with that anymore. If it still happens with git head phobos, it's 
probably not 14005/14578.

Alternatively, you can use std.stdio.readln directly, but be 
aware of issue 13856.


More information about the Digitalmars-d-learn mailing list