473,320 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

low level file system access to ntfs volumes... in .net?

hi all, hope you can help me with this question i've been scouring the net
for a couple of days now :-(.
is there any way to access the logical blocks on an ntfs volume from within
..NET? i'm thinking about starting a disk defragger project and want to know
where to get started. of course i have a long way to go before i can move
blocks around and end up with a drive that still has valid NTFS data on it
:-) but i want to at least confirm that i can do this much before investing
any more time.
if there's a way to do it using interop or calling platform (non .NET) code
i'm all ears as well, basically i can't even find how to access file system
stuff in anything but C, which doesn't help me much unless someone can give
me an example of how to use it.
thanks in advance for any help,
Aaron
Nov 16 '05 #1
3 4990
Aaron,

There is no native way to do this in .NET. Rather, you will have to
call Windows API methods to access the drive. If you list the APIs that you
want to call, we can easily translate them to their .NET declarations, which
you could then call in a similar (most likely) manner than you would in C
(with some changes, of course).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Aaron Oxford" <Aaron Ox****@discussions.microsoft.com> wrote in message
news:50**********************************@microsof t.com...
hi all, hope you can help me with this question i've been scouring the net
for a couple of days now :-(.
is there any way to access the logical blocks on an ntfs volume from
within
.NET? i'm thinking about starting a disk defragger project and want to
know
where to get started. of course i have a long way to go before i can move
blocks around and end up with a drive that still has valid NTFS data on it
:-) but i want to at least confirm that i can do this much before
investing
any more time.
if there's a way to do it using interop or calling platform (non .NET)
code
i'm all ears as well, basically i can't even find how to access file
system
stuff in anything but C, which doesn't help me much unless someone can
give
me an example of how to use it.
thanks in advance for any help,
Aaron

Nov 16 '05 #2
On Mon, 25 Oct 2004 06:29:04 -0700, Aaron Oxford <Aaron
Ox****@discussions.microsoft.com> wrote:
hi all, hope you can help me with this question i've been scouring the net
for a couple of days now :-(.
is there any way to access the logical blocks on an ntfs volume from within
.NET? i'm thinking about starting a disk defragger project and want to know
where to get started. of course i have a long way to go before i can move
blocks around and end up with a drive that still has valid NTFS data on it
:-) but i want to at least confirm that i can do this much before investing
any more time.
if there's a way to do it using interop or calling platform (non .NET) code
i'm all ears as well, basically i can't even find how to access file system
stuff in anything but C, which doesn't help me much unless someone can give
me an example of how to use it.
thanks in advance for any help,
Aaron


Defragging is (relatively) simple. The APIs exposed prevent any damage
from being done. See
http://blogs.msdn.com/jeffrey_wall/a...13/229137.aspx for
a C# wrapper for the Defrag APIs.

Austin
Nov 16 '05 #3
Thanks, both replies were swift and helpful. I believe I can get started with
this, at least enough to break a drive or two :-)

One last thing though, if someone could point me to the documentation on the
Windows APIs that guy's wrapper is calling it would help me understand what
I'm doing. I've been searching blind up to this point, not knowing what to
type into google or whatever. Even just name for the component of Windows
this is part of or the API being used would be almost as helpful as the
documents themselves.

Again thank you, I've never had such timely and to-the-point replies on any
forum, newsgroup, mailing list, you name it (experts-exchange.com - get outta
here!). I think I will begin to frequent this list and will even try to shed
some light on the areas of .NET I've played with. I'm loving the new language
and API so much that I'm dabbling with things all over the place - right now
I've got a little app checking to see if I have any duplicate pictures in my
porn collection, and once that's finished running it will be time to get back
into the DVD->WMV ripper. I guess Microsoft probably didn't have this sort of
thing in mind when they invented a whole new application framework but hey,
cheers to them and I'm learning APIs fast! Maybe I'll write something useful
one day. :-)

Aaron.

"Aaron Oxford" wrote:
is there any way to access the logical blocks on an ntfs volume from within
.NET? i'm thinking about starting a disk defragger project and want to know
where to get started. of course i have a long way to go before i can move
blocks around and end up with a drive that still has valid NTFS data on it
Aaron

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: HKannen | last post by:
Hi everybody, I'd like to create a link to a file instead of copying the file to the new destination. Is there a possibility to do this ? Is there something like a Link Object in C# .NET ? ...
9
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
9
by: Arsen V. | last post by:
Hello, What is the suggested way to store uploaded files? 1) IMAGE type data in an SQL Database table 2) As a file in the NTFS file system Thanks, Arsen
7
by: Zach | last post by:
The formatting system of my HD is NTFS. When I right click on a file in Windows Explorer, I get a Properties Window with only two tabs: "General" and "Summary". I don't get a Security Tab,...
8
by: Peter | last post by:
I'm trying to write a proceedure that will delete a file completely off a hardrive. I just don't want to kill the file. I want to rewrite over the data with 1's and 0's 8 times. Anyone have an...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
2
by: EP | last post by:
I'm looking for a method by which to access Windows files metadata and have not been able to find anything in the standard modules or via Google - what is the standard approach? Shamefully I...
18
by: bjorn.augestad | last post by:
We're planning to migrate our db to new and more disk drives, faster RAID levels and more dedicated disk usage(e.g. placing the translog on dedicated disks). The db server runs on Win2003. Right...
13
by: ragtag99 | last post by:
I posted this on comp.lang.asm.x86, alt.os.development, comp.arch, comp.lang.c++ Im working with windows xp professional, NTFS and programming with MASM, c++ (free compiler) or visual basic 6.0...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.