Monday, October 20, 2008

Path too long error

Just reinstalled Windows recently on my desktop system and last night I went looking around for an easier to manage SVN server for Windows and that's how I found VisualSVN server, which seems to be what I was looking for. While late and tired (blaming yourself for being a dumb**s is never the first option) I setup the app to store the repositories in the same folder where I had the original repository and then started importing the old repository in the same place with the same name, SVN_ROOT - I know, what are the odds for that happening again to someone else, right? statistics show that if something stupid is possible to do, someone else will most likely do it again, and then this post will prove very useful :-) Basically VisualSVN worked for a few good minutes in a loop and created a deep structure like this...



... which btw, you can't delete cause most Microsoft tools are compiled with MAX_PATH = 260 chars - Microsoft KB 177665. What to do? Tried a few tools, spent a half an hour on the net and luckly I found this post on David Cumps' blog - big thanks to James C-S and Kenny for a clever solution using Robocopy with /MIR (or /PURGE) parameters to basically mirror a blank folder on top of the folder you want to remove - in my case:

MKDIR D:\empty
ROBOCOPY D:\empty D:\SVN_ROOT\SVN_ROOT /MIR
RMDIR D:\SVN_ROOT\SVN_ROOT
I believe robocopy is included with Vista and Windows 2008 Server - for XP and 2003 Server, you find it as part of the Windows 2003 Resource Kit Tools.

2 comments :

  1. I had the similar problem and faced it a lot of times. I often solve this type of problems using "Long Path Tool". It helped me in solving this error and all related errors.

    ReplyDelete