mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
fix library Buffer( to Buffer.alloc( for node 10
This commit is contained in:
parent
c283224000
commit
46a8d96997
@ -34,7 +34,7 @@ function getFileMeta(root,path) {
|
|||||||
var read = 0;
|
var read = 0;
|
||||||
var length = 10;
|
var length = 10;
|
||||||
var remaining = "";
|
var remaining = "";
|
||||||
var buffer = Buffer(length);
|
var buffer = Buffer.alloc(length);
|
||||||
while(read < size) {
|
while(read < size) {
|
||||||
read+=fs.readSync(fd,buffer,0,length);
|
read+=fs.readSync(fd,buffer,0,length);
|
||||||
var data = remaining+buffer.toString();
|
var data = remaining+buffer.toString();
|
||||||
@ -63,7 +63,7 @@ function getFileBody(root,path) {
|
|||||||
var read = 0;
|
var read = 0;
|
||||||
var length = 50;
|
var length = 50;
|
||||||
var remaining = "";
|
var remaining = "";
|
||||||
var buffer = Buffer(length);
|
var buffer = Buffer.alloc(length);
|
||||||
while(read < size) {
|
while(read < size) {
|
||||||
var thisRead = fs.readSync(fd,buffer,0,length);
|
var thisRead = fs.readSync(fd,buffer,0,length);
|
||||||
read += thisRead;
|
read += thisRead;
|
||||||
|
Loading…
Reference in New Issue
Block a user