File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,3 +10,27 @@ and it will delete the specified folder and all of its contents. In order to
1010walk around limitations in the Windows API, we rename the folders to ` @ ` on
1111the way down the tree in order to shorten the path names, so that we don't
1212get errors because the path exceeds 250.
13+
14+ ## What's the matter?
15+
16+ When working with ` npm ` it is not unusal to get ` node_modules ` directory
17+ trees which are very deep, with paths reaching lengths of 400 or more
18+ characters.
19+
20+ Trying to delete these folders with the _ Windows Explorer_ results in
21+ error messages complaining about the fact that the _ path is too long_ and
22+ deletion becomes a nightmare.
23+
24+ To circumvent this problem, I've written this tiny naive tool which just
25+ walks the folder structure, renames every folder to a one-character length
26+ name while descending the tree, and then deletes everything while moving
27+ back up the tree.
28+
29+ ## I'm left with a folder called @
30+
31+ Sometimes, folders or files are in use (usually by the ` explorer ` process,
32+ but this might also be the antivirus kicking in) and the tool cannot delete
33+ or rename some folders or files.
34+
35+ Usually, the resulting folder structure has already been shortened enough so
36+ that you can simply delete the remaining garbage with the _ Windows Explorer_
You can’t perform that action at this time.
0 commit comments