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

David DeWitt via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 22 13:30:38 PDT 2015


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?

Here is what I am overall trying to achieve.

      auto recs = f  // Open for reading
                            .byLineCopy;
                            .array();
                            .map!(a=> 
assocArray(zip(h1.fullHeader, splitter(a,','))))
                            .map!(a=>a.byKeyValue()
                                     
.filter!(a=>h1.filteredHeader.canFind(a.key)));

         foreach(item;recs){
                            auto item = Json.emptyObject;
                            each!((k)=> item[k.key] = 
k.value)(item);
                            insert(item, dateIndex); 
//ElasticSearch
         }

Also any suggestions on the code are greatly appreciated :)


More information about the Digitalmars-d-learn mailing list