adspace
Answer Posted / Simpy Kumari
In Node.js, you can close a file by calling the fs.close() method on the file stream object obtained using the fs.openSync() or fs.readFileSync() functions. Here's an example: `const fs = require('fs'); const fileStream = fs.openSync('./myfile.txt', 'r+'); // Perform operations... fs.closeSync(fileStream);`
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers