@@ -395,6 +395,7 @@ function readFile(path, options, callback) {
395395 const h = vfsState . handlers ;
396396 if ( h !== null ) {
397397 const opts = typeof options === 'function' ? undefined : options ;
398+ if ( checkAborted ( opts ?. signal , callback ) ) return ;
398399 try {
399400 const result = h . readFileSync ( path , opts ) ;
400401 if ( result !== undefined ) {
@@ -2611,7 +2612,7 @@ function lchown(path, uid, gid, callback) {
26112612
26122613 const h = vfsState . handlers ;
26132614 if ( h !== null ) {
2614- const result = h . lchownSync ( path ) ;
2615+ const result = h . lchownSync ( path , uid , gid ) ;
26152616 if ( result !== undefined ) {
26162617 process . nextTick ( callback , null ) ;
26172618 return ;
@@ -2637,7 +2638,7 @@ function lchownSync(path, uid, gid) {
26372638
26382639 const h = vfsState . handlers ;
26392640 if ( h !== null ) {
2640- const result = h . lchownSync ( path ) ;
2641+ const result = h . lchownSync ( path , uid , gid ) ;
26412642 if ( result !== undefined ) return ;
26422643 }
26432644
@@ -2717,7 +2718,7 @@ function chown(path, uid, gid, callback) {
27172718
27182719 const h = vfsState . handlers ;
27192720 if ( h !== null ) {
2720- const result = h . chownSync ( path ) ;
2721+ const result = h . chownSync ( path , uid , gid ) ;
27212722 if ( result !== undefined ) {
27222723 process . nextTick ( callback , null ) ;
27232724 return ;
@@ -2744,7 +2745,7 @@ function chownSync(path, uid, gid) {
27442745
27452746 const h = vfsState . handlers ;
27462747 if ( h !== null ) {
2747- const result = h . chownSync ( path ) ;
2748+ const result = h . chownSync ( path , uid , gid ) ;
27482749 if ( result !== undefined ) return ;
27492750 }
27502751
@@ -2882,7 +2883,7 @@ function lutimes(path, atime, mtime, callback) {
28822883
28832884 const h = vfsState . handlers ;
28842885 if ( h !== null ) {
2885- const result = h . lutimesSync ( path ) ;
2886+ const result = h . lutimesSync ( path , atime , mtime ) ;
28862887 if ( result !== undefined ) {
28872888 process . nextTick ( callback , null ) ;
28882889 return ;
@@ -2912,7 +2913,7 @@ function lutimesSync(path, atime, mtime) {
29122913
29132914 const h = vfsState . handlers ;
29142915 if ( h !== null ) {
2915- const result = h . lutimesSync ( path ) ;
2916+ const result = h . lutimesSync ( path , atime , mtime ) ;
29162917 if ( result !== undefined ) return ;
29172918 }
29182919
@@ -2998,6 +2999,7 @@ function writeFile(path, data, options, callback) {
29982999 const h = vfsState . handlers ;
29993000 if ( h !== null ) {
30003001 const opts = typeof options === 'function' ? undefined : options ;
3002+ if ( checkAborted ( opts ?. signal , callback ) ) return ;
30013003 try {
30023004 const result = h . writeFileSync ( path , data , opts ) ;
30033005 if ( result !== undefined ) {
@@ -3137,6 +3139,7 @@ function appendFile(path, data, options, callback) {
31373139 const h = vfsState . handlers ;
31383140 if ( h !== null ) {
31393141 const opts = typeof options === 'function' ? undefined : options ;
3142+ if ( checkAborted ( opts ?. signal , callback ) ) return ;
31403143 try {
31413144 const result = h . appendFileSync ( path , data , opts ) ;
31423145 if ( result !== undefined ) {
@@ -3547,6 +3550,11 @@ function realpathSync(p, options) {
35473550 * @returns {string | Buffer }
35483551 */
35493552realpathSync . native = ( path , options ) => {
3553+ const h = vfsState . handlers ;
3554+ if ( h !== null ) {
3555+ const result = h . realpathSync ( path , options ) ;
3556+ if ( result !== undefined ) return result ;
3557+ }
35503558 options = getOptions ( options ) ;
35513559 return binding . realpath (
35523560 getValidatedPath ( path ) ,
@@ -3725,6 +3733,19 @@ function realpath(p, options, callback) {
37253733 */
37263734realpath . native = ( path , options , callback ) => {
37273735 callback = makeCallback ( callback || options ) ;
3736+ const h = vfsState . handlers ;
3737+ if ( h !== null ) {
3738+ try {
3739+ const result = h . realpathSync ( path , options ) ;
3740+ if ( result !== undefined ) {
3741+ process . nextTick ( callback , null , result ) ;
3742+ return ;
3743+ }
3744+ } catch ( err ) {
3745+ process . nextTick ( callback , err ) ;
3746+ return ;
3747+ }
3748+ }
37283749 options = getOptions ( options ) ;
37293750 path = getValidatedPath ( path ) ;
37303751 const req = new FSReqCallback ( ) ;
0 commit comments