2006-07-20

Foo.

Something I learned today..

Windows XP's explorer doesn't appear support long path names (ie. paths over MAX_PATH, 260 characters long), neither do the GnuWin32 utils.

This is a major pain, if, for some strange reason (don't ask) you happen to have accidentially created a large number of folders called "foo", each being a child of the next.. you can't delete or browse them, the only operation that works is move (rename).

Simple solution; run the following a few times:

for /F "usebackq" %f in (`seq 1 500`) do mv foo foo2 & mv foo2\foo . & rm -r foo2

Oh, such a nasty hack.

For anyone who doesn't have a clue what's going on there, all it does is (500 times): Rename 'foo' to 'foo2'. Move 'foo2''s first child to the current directory. Delete (the now empty) 'foo2'.

Simple, eh?


Commenting is disabled for this post.

Read more of Faux' blog