Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: Is the file fragmented

15 views
Skip to first unread message

David L. Bork

unread,
Dec 8, 2006, 10:06:00 AM12/8/06
to
Jakob,

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 ?

0 new messages