fs: use fs.access in fs.exists
Uses fs.access()
to implement fs.exists()
functionality. Fixes a issue, when a file exists but user does not have privileges to do stat on the file.
Fixes: https://github.com/nodejs/node/issues/17921
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
fs