Beowulf Posted May 22, 2004 Posted May 22, 2004 I have a C# .NET file copying program that does recursive copies of entire directories and contents. Everything has been going great until just recently... I've run into a problem where I am getting a PathTooLongException thrown when the directory structure is particularly deep or I get an insanely long file name. The error message I am getting is: "The path is too long after being fully qualified. Make sure path is less than 260 characters." A 260 character limitation on the path has come as a big shock to me. Is there a way around this? Am I missing something obvious? Quote
Administrators PlausiblyDamp Posted May 22, 2004 Administrators Posted May 22, 2004 IIRC that is a limitation of windows itself - so the short answer is probably nothing can be done short of renaming the foles/folders to a shorter name or not nesting to quite that degree. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Beowulf Posted May 24, 2004 Author Posted May 24, 2004 Hmmm... doing a little digging I found this in the Robocopy documentation (Robocopy is a nifty copy utility and is part of the Resource Kit): "Previous versions of Robocopy would fail to copy any pathname longer than 256 characters. The program now has been enhanced to handle pathnames of any length, up to the internal Windows limit of nearly 32,000 characters." This makes me think there is some setting in Windows or some other copy function that could be used which doesn't have the limited path length. For instance, I can drag-n-drop this entire directory structure and it copies without a complaint. I've been Googling, but no luck yet on finding an answer. Quote
Administrators PlausiblyDamp Posted May 24, 2004 Administrators Posted May 24, 2004 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/naming_a_file.asp may contain some useful info if you read down the page. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.