manidlou / node-klaw-sync

Node.js recursive synchronous fast file system walker
MIT License
157 stars 10 forks source link

EPERM dir or file error #16

Open weihsu932 opened 5 years ago

weihsu932 commented 5 years ago

When the path is D:\ or C:\ on Windows, had the error which operation not permitted. Maybe should to have options for ignore the error and keep to walking directory.

{ Error: EPERM: operation not permitted, stat 'D:\\System Volume Information'
    at Object.statSync (fs.js:850:3)
    at Object.statSync (D:\...\node_modules\graceful-fs\polyfills.js:295:24)
    at klawSync (D:\...\node_modules\klaw-sync\klaw-sync.js:16:24)
....
}
manidlou commented 5 years ago

the error originally comes from graceful-fs. idk how consistent the error is but maybe the user doesn't have permissions for the operation!

manidlou commented 5 years ago

anyhow maybe that'b be better to direct the suggestion to the graceful-fs repo to provide that! because I suppose if that's the case a lot of users will experience that and that'd be better that would be handled by the fs library.