by throwasfwa331 · 3y ago · 0 comments
let totalSize = 0;
const fileListHandle = await open("file-list.txt", "r");
try {
for await (const line of fileListHandle.readLines()) {
const lineFileHandle = await open(lineFileHandle, "r");
try {
totalSize += await lineFileHandle.read().bytesRead;
} finally {
await lineFileHandle.close();
}
}
} finally {
await fileListHandle.close();
}
console.log(totalSize);No comments yet.