Since low-level is not available through .NET you will need to create a
wrapper to get the information you need. See the website
http://www.componentsnotebook.com/notebooks/csharp/deviceio.aspx for an
example.
The FSCTL_GET_RETRIEVAL_POINTERS control code retrieves a data structure
that describes the allocation and location on disk of a specific file.
To perform this operation, call the DeviceIoControl function with the
following parameters.
BOOL DeviceIoControl(
(HANDLE) hDevice, // handle to volume
FSCTL_GET_RETRIEVAL_POINTERS, // dwIoControlCode
(LPVOID) lpInBuffer, // input buffer
(DWORD) nInBufferSize, // size of input buffer
(LPVOID) lpOutBuffer, // output buffer
(DWORD) nOutBufferSize, // size of output buffer
(LPDWORD) lpBytesReturned, // number of bytes returned
(LPOVERLAPPED) lpOverlapped // OVERLAPPED structure
);
-David
"Jakob Bindslet" wrote:
> Is it possibly to determine if a given file is fragmented from PowerShell -
> either through WMI og .NET ?