[xplorer˛] — Stress testing folder hierarchies
home » blog » 21 June 2009
play flash demo
 

In the dark ages where computers weren't quite pentium quad core spec and they cost an arm and a leg and had less computing power than modern wrist-watches, operating system architects were cutting corners high and low to make do with the limited resources of the early PCs. One that will be our today's subject is the maximum folder path length of 260 characters overall (MAX_PATH constant). This filename limit is still present in the third millenium AD despite microsoft's claims to the contrary — to my experience the \\?\D:\ path prefix is not working.

When this 260 character limit was introduced folder names were only 8 characters long and file names (up to) 12 characters — 8 for base name and 3 for extension, hence 8.3 format like 12345678.TXT. With such short names, you could have hierarchies 27 levels deep and still fall within the MAX_PATH constraint. Nowadays there are no such 8.3 length restrictions for file or folder names. Users can use long names and many of you take advantage of this filesystem feature to give your folders descriptive names as a reminder of the content e.g. "new york trip on christmas 2008 with harry enfield and chums".

If you are the type that likes naming folders in this fashion you will soon realize that the 260 character limit will come to haunt you. This concerns the overall path length so a few long folder names will add up and you'll hit the limit in hierarchies just 3-4 levels deep. In such situations you will find that there's not much you can do with file management; you can't create deeper files or folders. I have heard of pranks and viruses that create such deep paths which cannot be easily removed since they exceed the maximum path limit. Your file manager gives up and just gives error messages like:

  • path too long
  • the filesystem cannot find the file specified
  • the filename or extension is too long

Here's what you can do if you find yourself in this situation:

  • Use 8.3 paths to reach the files. Unless you have disabled 8.3 names they exist in parallel with long path names. So a folder called "E:\temp\long path" can be also accessed as E:\temp\LONGPA~2 — notice the funny tilde to shorten the path down to 8 characters and waste spaces. In this fashion a path that is too long normally will be quite manageable in 8.3 trim. You can get the equivalent 8.3 path using xplorer˛ <Shift+Alt+C> command (Edit > Copy names menu). With the short name you can open a console window and copy or delete deep files.
     
  • Use folder junctions for back-door access. If you can't remember the MSDOS commands there's a modern equivalent. Using folder junctions you can create a shortcut to the deep folder that is placed higher up in the folder structure and has much shorter length overall e.g.
    From: c:\level1\level2\level3\level4\level5\level6\
        To: c:\junction to 6\
    Effectively you access the same folder via a shorter path name and you bypass the original length problem. You can create folder junctions using xplorer˛ Edit > Paste special > Folder junction menu.

For more information on this extreme condition see today's demo video

Keep in mind that if you use long descriptive names for your folders you will get in trouble sooner or later. Here are some possible workarounds:

  • Use conscise folder names, long but not that long
  • Don't nest your folder hierarchies too deeply or at least keep the higher branches as short as possible
  • Use folder comments to add descriptions, leaving the folder name short

Addendum: Later xplorer˛ versions (starting from build 3.306) support extra long folder names (up to the system limit of 32767 characters). You can do most file operations in deep folders, but there are a few hiccups because windows shell and windows explorer are still limited to MAX_PATH (260 letters).

Post a comment on this topic

 

 

What would you like to do next?

Reclaim control of your files!
  • browse
  • preview
  • manage
  • locate
  • organize
Download xplorer2 free trial
"This powerhouse file manager beats the pants off Microsoft's built-in utility..."

download.com
© 2002—2009 Nikos Bozinis, all rights reserved