Skip to content

Different behaviour when removing unowned files #11

@radare

Description

@radare

this node module removes the foo/bar directory, but not the foo one. So the directory is not empty
The system rm will just not remove anything because the foo/bar file is not owned by the user. So maybe we want to add some extra parameters

mkdir -p foo/bar
chmod 000 foo/bar
sudo chown root foo/bar
rm -rf foo
find foo 2> /dev/null
echo ===================
node index.js > /dev/null
find foo

index.js contains:

const rmdir = require('rmdir');
rmdir ('foo', (err, dirs) => {
        if (err) console.error ('Cannot find dir');
        else console.log(dirs);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions