“LongPathSupport”: Operate with files and directories with “long paths” in .NET (CodePlex Project)

In my project RoboPowerCopy (http://robopowercopy.codeplex.com) I’ve implemented a basic set of classes and methods for use with files and directories with long paths. NTFS supports paths with up to 32000 characters. But .NET only supports 256 characters. So System.IO.FileInfo and System.IO.DirectoryInfo will not work with such a file:

c:usersikarsteinappdatalocal111112222233333444445555566666777778888899999000001111122222333334444455555666667777788888999990000011111222223333344444555556666677777888889999900000111112222233333444445555566666777778888899999000001111122222333334444455555666667777788888999990000011111222223333344444555556666677777888889999900000111112222233333444445555566666777778888899999000001111122222333334444455555666667777788888999990000011111222223333344444555556666677777888889999900000111112222233333444445555566666777778888899999000001111122222333334444455555666667777788888999990000011111222223333344444555556666677777888889999900000hello.txt

This path has 655 characters. No way in .NET without using the Win32 API.

I’ve wrapped the API calls into a set of basic .NET classes to provide a basic support for files and directors with long paths…

Here it is: http://longpathsupport.codeplex.com

Please feel free to contribute the project or post you experiences on my blog or on Codeplex!

For the project I’ve read/used some other source in the Internet. Especially this three I’d like to refer to:

One thought on ““LongPathSupport”: Operate with files and directories with “long paths” in .NET (CodePlex Project)

Leave a Reply to GabrielNar Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.