Meshbeyn / Projects

NTFS Extensions Project

The .Net platform supports only few features of NTFS. Developers have to ignore almost all features or to call WinAPI functions directly using interop. Many functions used to work with NTFS need a long preparing of data and sometimes multiple calls to execute a single operation. My project implements this calls in .Net style, so everybody may use they like classes and methods from .Net library.

Most of methods may be called as static or extension methods. You may call static methods of classes from this library or extension methods of .Net classes like Stream or FileInfo. To use extension methods just import the namespace NTFSExtensions.

Files

Currently published version is 0.1. Version 0.2 needs refactoring and is not available now.

Last version of library: NTFSExtensions.dll

Supported NTFS features

Library hierarchy

Working classes

static class Compression

This static class is used to work with compressed and sparse streams.

GetAllocatedRanges
Returns allocated ranges of stream. This function is very helpful to process only the parts of steam, that contain useful information.
GetLengthCompressed
Returns physical length of stream taking into account compression or sparseness. For regular streams the logical length is returned.
GetZeroRanges
Returns deallocated ranges of stream.
RefillZeroRegions
Reallocates deallocated ranges by filling they with zero bytes. This function shall be called before unset the sparse attribute.
SetCompressedAttribute
Make the stream compressed or plain.
SetSparseAtribute
Make the stream sparse or plain.
SetZeroData
Fills a region with zero bytes. If the stream is sparse and the region is sufficently long, some clusters may be deallocated.

Data classes and structures

struct Range
Structure modeling a range in a stream.
class VolumeInformation
Class modeling base parameters of volume formating.