1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

fix file node to overwrite multiple files

This commit is contained in:
Dave Conway-Jones 2017-06-28 13:28:01 +01:00
parent 283d5c64cb
commit b515df611d
No known key found for this signature in database
GPG Key ID: 81B04231572A9A2D

View File

@ -59,12 +59,10 @@ module.exports = function(RED) {
while (node.data.length > 0) { while (node.data.length > 0) {
if (this.overwriteFile === "true") { if (this.overwriteFile === "true") {
if (!node.wstream) { node.wstream = fs.createWriteStream(filename, { encoding:'binary', flags:'w' });
node.wstream = fs.createWriteStream(filename, { encoding:'binary', flags:'w' }); node.wstream.on("error", function(err) {
node.wstream.on("error", function(err) { node.error(RED._("file.errors.writefail",{error:err.toString()}),msg);
node.error(RED._("file.errors.writefail",{error:err.toString()}),msg); });
});
}
} }
else { else {
if (!node.wstream) { if (!node.wstream) {