3 ms·
I see the segfault in one of the prompt as well. > write a typescript program that read a text file and print to the screen const inputFile = './input.txt';
by mrbonner 4y ago
I see the segfault in one of the prompt as well.
> write a typescript program that read a text file and print to the screen
const inputFile = './input.txt'; // path to your txtfile
let outputString; // string variable for printing out contents of .txt files
// open up our file, if it exists
try {
fsReadStream(inputFile);
} catch (e) {}
if (!!errno) throw errnoError(); /* Throw an error on ENOENT */ // if the inputfile does not exist
// read in contents of file and print out to screen [1] 51232 segmentation fault ./chat