Is there a way to specify the size/length of a file and have the system reserve the space needed? I'm looking for something like:
fs.write('file', Buffer, 1024*1024*54); // To create 54MB file.
Is there a way to specify the size/length of a file and have the system reserve the space needed? I'm looking for something like:
fs.write('file', Buffer, 1024*1024*54); // To create 54MB file.
Share
Improve this question
asked Jun 20, 2015 at 9:35
MatBeeMatBee
2846 silver badges17 bronze badges
1
- See this example for a decent implementation. – Patrick Roberts Commented Jun 20, 2015 at 9:46
1 Answer
Reset to default 7Just create a Buffer of that size?
fs.writeFile('file', new Buffer(1024*1024*54));