views:

605

answers:

3

I try to work with DirectoryInfo, FileInfo with very long path.

  • I try use \\?\c:\long path (i got illegal caracter with fileInfo and DirectoryInfo)
  • I try use file://c:/long path (i got uri not supported)

Can i use ~ in a path or something else.

I read this post but i would like to use another way that call a API. Is it any other solutions ?

There is an article from microsoft for use \\? in file path link text

The question is how can i work with very long path, and DirectoryInfo, and FileInfo for path who are more longer that 256 char

+4  A: 

Looking at the Long Paths in .NET blog post series, it looks like going to the Win32 API through P/Invoke is the only solution at the moment, other than restructuring your directories so that you don't hit the limit.

bdukes
+1  A: 

A way I solved this issue in the past was using the library from Delimon called Delimon.Win32.IO. It looks like his site http://www.delimon.be is down at the moment. But I had used it on a project in the past and it worked like a champ. I can try to track it down for you later this evening or just try to find a valid link to it somewhere via google. Cheers. Here's another link talking discussing this issue.

http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/2541a9b9-acd7-4338-89b1-dfc0408e41b5

ElvisLives
A: 

Hi ElvisLives,

is it possible to get the "Delimon.Win32.IO.dll" from you, and how. www.delimon.be seems permanent down.

HarryBo