Friday, December 30, 2011

Problem Copying Large Path Files

Some time ago I saw one problem as a consequence of a project, this consisted on moving all directories from one network device to an external drive as a backup policy. But, during the copying process happened problems with certain directories and files, an unknown error actually.

However, I got the impression that this problem could be produced by the large length of the paths of this directories or files and yes, that was the reason.

As a proof of this, I created a large path for a directory that just contains one text file, as you can see "D:\Large Named Directory" has a lot of similar inner directories, having the last one the "Large Named Textfile.txt" file. Pay attention, because it's not possible to create more directories inside the last one, because Windows has a limit... like everything in life.

Now, the image showed before represents the directories in the network drive, and we are going to copy them to a new directory located in the "local drive" which is represented by "D:\Another Large Directory to Copy Directory" directory, but when we do this simple procedure, we get this error message.


All of this because the file in the first location had a full path with less than 256 characters, however, in the new location it would have needed a full path with more than 256 characters which is not allowed by Windows. So, what you have to do in this situation is changing the path directory destination to the shortest name to not exceed the 256 path length limit.

 

4 comments:

  1. you must be a really genius for figuring that out... :trollface:

    ReplyDelete
    Replies
    1. Hahahaha believe it or not it happened to me at work =)

      Delete
  2. This issue can be resolved simply by using Long Path Tool program. I have been using this from last month. This is great.

    ReplyDelete
    Replies
    1. Nice tip, I didn't know about that program. Thanks =)

      Delete