Path too long?

Posted by

Why do so many people think the 260 character limit on path names is an operating system limitation? It’s not!

The operating system can access paths up to 32,000 characters long (or a bit more). Individual components of a path are limited to 248 characters, but not the entire path.

Many applications assume the limit is 260 (thank you MAX_PATH!) It’s really quite hard trying to explain to my parents that the reason that Excel can’t open their file (that they just saved, by the way) is because the entire path name is too long (“what’s a path?” they’ll ask; “I just saved it in My Documents,” they say; “copy the file to where?” they ask – as far as they’re concerned, the file system is made up of everything under My Document, and that’s it).

In my opinion, this problem is much exacerbated by the fact that the System.IO namespace in .NET also has the exact same crazy limitation. Try to access files where the FullName is > 260 characters, and you get PathTooLongExceptions all over the place. And there’s nothing you can do about it, except write some sort of native file wrapper class that works properly – who’s going to do that?!

Microsoft had the perfect opportunity to remove this lame limitation with .NET. But it’s still there! Hopefully future versions can fix it.

blog comments powered by Disqus