fix: race condition
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
a9b5db234f
commit
553f58271e
1 changed files with 1 additions and 1 deletions
|
|
@ -137,8 +137,8 @@ function ArrayBufferToBuffer(ab) {
|
||||||
|
|
||||||
const ReadBytes = async (filePath, offset, size) => {
|
const ReadBytes = async (filePath, offset, size) => {
|
||||||
const sharedBuffer = Buffer.alloc(size);
|
const sharedBuffer = Buffer.alloc(size);
|
||||||
const stats = fs.statSync(filePath); // file details
|
|
||||||
const fd = fs.openSync(filePath); // file descriptor
|
const fd = fs.openSync(filePath); // file descriptor
|
||||||
|
const stats = fs.fstatSync(fd); // file details
|
||||||
let bytesRead = 0; // how many bytes were read
|
let bytesRead = 0; // how many bytes were read
|
||||||
|
|
||||||
for (let i = 0; i < size; i++) {
|
for (let i = 0; i < size; i++) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue