From 4cbe2648690d6cdc8d1116150ebbfe184669e63d Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Thu, 22 Dec 2016 13:17:08 +0000 Subject: [PATCH] Change file node to use node 4 syntax (drops support for 0.8) --- nodes/core/storage/50-file.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nodes/core/storage/50-file.js b/nodes/core/storage/50-file.js index 3eed20736..e65b12b93 100644 --- a/nodes/core/storage/50-file.js +++ b/nodes/core/storage/50-file.js @@ -45,8 +45,8 @@ module.exports = function(RED) { data = new Buffer(data); if (this.overwriteFile === "true") { // using "binary" not {encoding:"binary"} to be 0.8 compatible for a while - fs.writeFile(filename, data, "binary", function (err) { - //fs.writeFile(filename, data, {encoding:"binary"}, function (err) { + //fs.writeFile(filename, data, "binary", function (err) { + fs.writeFile(filename, data, {encoding:"binary"}, function (err) { if (err) { if ((err.code === "ENOENT") && node.createDir) { fs.ensureFile(filename, function (err) { @@ -71,8 +71,8 @@ module.exports = function(RED) { } else { // using "binary" not {encoding:"binary"} to be 0.8 compatible for a while longer - fs.appendFile(filename, data, "binary", function (err) { - //fs.appendFile(filename, data, {encoding:"binary"}, function (err) { + //fs.appendFile(filename, data, "binary", function (err) { + fs.appendFile(filename, data, {encoding:"binary"}, function (err) { if (err) { if ((err.code === "ENOENT") && node.createDir) { fs.ensureFile(filename, function (err) {