File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 4
4
// See https://github.com/libuv/libuv/pull/1501.
5
5
const kIoMaxLength = 2 ** 31 - 1 ;
6
6
7
+ // Note: This is different from kReadFileBufferLength used for non-promisified
8
+ // fs.readFile.
9
+ const kReadFileMaxChunkSize = 2 ** 14 ;
10
+ const kWriteFileMaxChunkSize = 2 ** 14 ;
11
+
7
12
const {
8
13
MathMax,
9
14
MathMin,
@@ -150,16 +155,12 @@ async function writeFileHandle(filehandle, data) {
150
155
do {
151
156
const { bytesWritten } =
152
157
await write ( filehandle , data , 0 ,
153
- MathMin ( 16384 , data . length ) ) ;
158
+ MathMin ( kWriteFileMaxChunkSize , data . length ) ) ;
154
159
remaining -= bytesWritten ;
155
160
data = data . slice ( bytesWritten ) ;
156
161
} while ( remaining > 0 ) ;
157
162
}
158
163
159
- // Note: This is different from kReadFileBufferLength used for non-promisified
160
- // fs.readFile.
161
- const kReadFileMaxChunkSize = 16384 ;
162
-
163
164
async function readFileHandle ( filehandle , options ) {
164
165
const statFields = await binding . fstat ( filehandle . fd , false , kUsePromises ) ;
165
166
You can’t perform that action at this time.
0 commit comments