iopipe code to count lines in gzipped file works with v 0.1.7 but fails with 0.2.1

Andrew aabrown24 at
Fri Aug 7 13:40:46 UTC 2020


This code to count lines in a gzipped file exits with "Program 
exited with code -9" when run with the latest version of the 
library, I guess because I am doing unsafe things. Could someone 
tell me how to change it to make it work? The actual program I'm 
writing processes a file line by line, so ideally I'd like to 
keep the structure of open a file, then foreach over it.

Thanks very much


/+ dub.sdl:
	name "hello"
	dependency "iopipe" version="~>0.2.0"

import std.stdio;
import std.typecons;
import iopipe.textpipe;
import iopipe.bufpipe;
import : File = File;

void main()
   auto counter = 0;
   auto fileToRead = 

   foreach (line; fileToRead.assumeText.byLineRange!false)


More information about the Digitalmars-d-learn mailing list