You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -519,12 +520,11 @@ async function readFileHandle(filehandle, options) {
519
520
520
521
letsize=0;
521
522
letlength=0;
522
-
constmaxFileSize=2**31-1;// 2 GiB limit for file size
523
523
524
524
if((statFields[1/* mode */]&S_IFMT)===S_IFREG){
525
525
size=statFields[8/* size */];
526
526
527
-
if(size>maxFileSize){
527
+
if(size>kIoMaxLength){
528
528
process.emitWarning(
529
529
`Warning: Detected \`fs.readFile()\` to read a huge file in memory (${size} bytes). Please consider using \`fs.createReadStream()\` instead to minimize memory overhead and increase the performance.`,
0 commit comments