0

I need an answer on this magic question:

I use fs.createWriteStream to write a text file to "storage/sd/" (as like at BrightSign documentations) and it is work good at first any times. After any times I'm starting to get the message "EROFS: read-only file system".

What can be a reason of it if then it is work good on non-brightsign-devices every time?

BrightSign OS is using Node.js 14.x

First version

function writeFile(...messageArray:string[]): void {
   let writeStream = fs.createWriteStream(file_path, {flags: "a", autoClose: true});
   writeStream.write(messageArray.join("\n"));
}

Second version

function writeFile(...messageArray:string[]): void {
   let writeStream = fs.createWriteStream(file_path, {flags: "a", autoClose: true});
   writeStream.write(messageArray.join("\n"));
   writeStream.on("finish", () => console.log("complete"));
   writeStream.on("error", err => console.log(err));
}

at both versions the sutiation are fully same.

0 Answers0