Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing direct to a particular disk sector

Status
Not open for further replies.

kevinf2349

Technical User
Sep 12, 2002
367
US
I have a strange need....but enough about my private life...seriously though.

Is it possible to use VB.Net to write directly to a particular spot on a disk? Essentially what I need to do is the equivalent of zapping a bit in a file but I need to do it in place so I effectively want to write a value to a very specific place on a disk.

Is it possible and if so how is the best way of going about it? I have tried to read the file in memory with a binary reader and then write it back out but the file is showing corrupt. I suspect that the problem is that the internal data structure of that particular file is a little weird.
 
You would need to write some C code that would talk to a disk device driver. User-mode code under NT/2k/XP can't read/write to a specific sector as that would be a security violation (the OS would stop you).

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top