Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...