This project is read-only.

AlphaFS is great but, why not work like the MS's implementation?

Sep 24, 2012 at 7:43 AM

You know there is another library called Long Path from Microsoft on CodeFlex. Microsoft's library recognises long paths, even when they do not start with \\?\. So it was very easy to use it, because I can just use them without thinking whether the path is a long path or a normal path. 

 

But with AlphaFS, passing a long path that does not start with \\?\ causes problems. Since I do not want to present \\?\ to users, I use/store paths without \\?\. So whenever I use AlphaFS, I need to convert them like;

 

using Long = Alpha......;

string longPath = Long.Path.GetLongPath(path);

 

Why can't all methods in AlphaFS take long paths without \\?\? If it worked that way, I did not have to modify most of my existing application.

Developer
Sep 24, 2012 at 8:43 AM
Edited Sep 24, 2012 at 8:43 AM

Hi,

In what situations and/or what methods cause problems when using LongPaths?

The idea is that AlphaFS should work with LongPaths internally as much as possible, but we might have missed a few.

If you don't want to present a LongPath to your users, you can always make use of:

Path.GetRegularPath(string path);

Gets the regular path from long prefixed one. i.e. \\?\C:\Temp\file.txt to C:\Temp\file.txt

Sep 24, 2012 at 5:23 PM

typingcat,

AlphaFS did in fact worked seamlessly with long paths in one of the old development builds, HOWEVER it lead to more problems than benefits.

* there are too many inconsistencies in the Win32 API itself where some methods accept long paths, and some do not

* as this is just a library, the decision on whether  to work with long paths should be made by the upper code that imports it, as most of the other higher Windows libraries and .NET methods do not work with long paths at all. So your code should take responsibility of knowing when and when not to use the long paths functions.

* the headache of short/long paths was made by MS and not AlphaFS, so general frustration should be directed to Windows dev department :)

Marked as answer by Yomodo on 1/19/2014 at 9:44 PM