Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update comments
  • Loading branch information
RaisinTen committed Jun 3, 2021
commit 9596fdc526b75cc81d25bf12908beda23f500249
16 changes: 8 additions & 8 deletions test/parallel/test-fs-rm.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@ function removeAsync(dir) {
// IBMi has a different access permission mechanism
// This test should not be run as `root`
if (!common.isIBMi && (common.isWindows || process.getuid() !== 0)) {
// On Windows, we are allowed to access and modify the contents of a
// read-only folder.
// Check that deleting a file that cannot be accessed using rmsync throws:
// https://github.com/nodejs/node/issues/38683
{
// Check that deleting a file that cannot be accessed using rmsync throws:
// https://github.com/nodejs/node/issues/38683
function isValidState(exists, err) {
// On Windows, we are allowed to access and modify the contents of a
// read-only folder.
return common.isWindows ?
(exists === false && err === null)) :
(exists === true && err?.code === 'EACCES'));
Expand Down Expand Up @@ -358,12 +358,12 @@ function removeAsync(dir) {
}
}

// On Windows, we are not allowed to delete a read-only directory.
// Check endless recursion.
// https://github.com/nodejs/node/issues/34580
{
// Check endless recursion.
// https://github.com/nodejs/node/issues/34580
function isValidState(exists, err) {
// TODO(RaisinTen): Replace the error code with 'EACCES' if this lands:
// On Windows, we are not allowed to delete a read-only folder yet.
// TODO(RaisinTen): Remove Windows special-casing if this lands:
// https://github.com/libuv/libuv/pull/3193
return common.isWindows ?
(exists === true && err?.code === 'EPERM') :
Expand Down