Wednesday, February 09, 2011

AlphaFS v1.5 Released (think "The 'Long Path' IO support the BCL doesn't yet have..." or "Don't 'W' [Wide/Unicode API/etc] P/Invoke your Path API's when AlphaFS has done it already for you..." or "How I learned to love and use Volume Shadow Service paths from .Net")

CodePlex - AlphaFS

"Project Description

AlphaFS is a .NET library providing more complete Win32 file system functionality to the .NET platform than the standard System.IO classes. Features highlights: creating hardlinks, accessing hidden volumes, enumeration of volumes, transactional file operations and much more.

News - AlphaFS 1.5 Stable Released

AlphaFS has now reached a stable state. Many improvements and bugfixes has been made since the beta and it is now considered stable enough for production use.


The file system support in .NET is pretty good for most uses. However there are a few shortcomings, which this library tries to alleviate. The most notable deficiency of the standard .NET file system support was discovered in our attempts to work with the Windows Volume Shadow Copy Service (VSS) (See VSS creates snapshots of volumes, but on Windows XP does not allow exposing this snapshot as a standard drive letter. There is a hack using the CreateDosDevice Win32 API function, but the solution is not very elegant.

Exposing drive letters works on Windows Vista and later, but it may not be desirable from eg. a backup application, to suddenly have a number of new drive letters turn up in explorer. The paths through which the shadow copies are available are extended-length paths, eg. "\\?\Volume{12345678-aac3-31de-3321-3124565341ed}\Program Files" instead of simply "C:\Program Files". However, these paths cannot be accessed using the file system functions exposed by System.IO.

What does AlphaFS provide?

AlphaFS provides a namespace (Alphaleonis.Win32.Filesystem) containing a number of classes. Most notable are replications of the System.IO.File, System.IO.Directory and System.IO.Path, all with support for the extended-length paths discussed above. They also contain extensions to these, and there are more options for several functions.

Another thing AlphaFS brings to the table is support for transactional NTFS (TxF). Almost every method in these classes exist in two versions. One normal, and one that can work with transactions, more specifically the kernel transaction manager. This means that file operations can be performed using the simple, lightweight KTM on NTFS file systems, through .NET, using the interface of the standard classes we are all used to.

AlphaFS also contains a little security related functionality (in Alphaleonis.Win32.Security), providing the ability to enable token privileges for a user, which may be necessary for eg. changing ownership of a file.

The library comes with full API documentation in CHM and Windows Help 2.x format.

The library is Open Source, licensed under the MIT license.


AlphaFS - 1.5 Stable


This version includes numerous bug fixes, new methods, optimizations and unit tests.
It has been tested in several live applications and proved to be stable enough for release.
For directory traversal and file searches use new enumeration methods in the Directory class



As stated above, there's a CHM for doc's


A good bit of code;


A metric ton of P/Invoke's


Unit tests, a MIT licensed project and source that downloads and compiles the first time...


Related Past Post XRef:
AlphaFS – Some Max_Path, Transactional NTFS, hard links, and more .Net System.IO.File/Path/Directory Help (alpha)

The Long Path for the BCL Team
Introduction of the BCL CodePlex project (code samples, previews, prototypes, etc from the BCL team) – Includes “Long Path” library direct from the BCL Team (think “Breaking out of MAX_PATH”)

1 comment:

Pawan Yadav said...

You can use Long Path Tool as well, it hands such issues!