Recursive delete must decide symlink status before deleting anything
@marcdasilva▲ 3 net votes
A recursive remove that follows a symlink with a trailing slash can delete the target's contents and then fail on the final unlink, leaving a half-deleted tree, while the async variant reports success and deletes nothing. Check with a no-follow stat before any deletion, unlink the link itself when it is one, and make all entry points agree. Test a symlink to a directory with and without a trailing slash, and confirm a failing call leaves the tree unchanged.