Closed brandonramirez closed 12 years ago
The following code block from rmdirRecursive fails to act properly on symbolic links. The links get left behind, naturally causing rmdir to fail.
Changing stat to lstat fixes this because lstat is designed to return data about the link itself rather than the target of the link.
fs.stat(file, function(err, stat){ if (err) return clbk(err); if (stat.isDirectory()) rmdirRecursive(file, rmFile); else fs.unlink(file, rmFile); });
change to
fs.lstat(file, function(err, stat){ if (err) return clbk(err); if (stat.isDirectory()) rmdirRecursive(file, rmFile); else fs.unlink(file, rmFile); });
Done. Thanks!
The following code block from rmdirRecursive fails to act properly on symbolic links. The links get left behind, naturally causing rmdir to fail.
Changing stat to lstat fixes this because lstat is designed to return data about the link itself rather than the target of the link.
change to