fs: create consistent behavior for fs module across platforms
In Windows, if a file name ends with forward slash /
, fs interprets it as regular file (like there is no slash at all) and does not throw any errors. In Linux it throws error but not in Windows.
Fixes: https://github.com/nodejs/node/issues/17801
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
fs