Windows has a limit on the length of file paths
While moving a folder, with many subdirectories, to the Recycle Bin under Windows XP:
I wondered if each file that is stored in the recycle bin has a "original path" attribute, with a max length 256 chars, and that stores the original path like "Dir1Dir2Dir3file.txt". Maybe if files are nested too deeply that attribute cannot hold the value?
While checking some files into a subversion repository:
- The repository was D:\Adrian\my-respository
- Within the repository I had quite a deep directory structure, to access this particular project
- Within this particular project, the IDE I was using had a few levels of directories, to include "work/src" and so on
- The class path of the Java classes was quite deep, "com/company/project" etc
- Subversion itself puts a few levels of dirs in ".svn/text-base" and so on
While checking in all this stuff, I got the error "path invalid" suddenly. And opening the created .svn directory in Windows Explorer, right-clicking, and chooseing "new directory" immediately brought up the error:
Cannot create 'New Folder': path invalid
So it seems paths have a limit in Windows. The existing working path was 220 characters long, with 20 directories including the working directory and the hard disk's root directory.
This is all very annoying, as I can't really do anything about any of the above reasons why the path is so long.