reading FAT
Janardan R. Sethi -- sethijr@logic.clarkson.edu
Sunday, December 08, 1996
Hi,
Environment: VC++ 4.0 Windows NT 4.0
My application requires that i read the file allocation table(FAT) of
the WinNT OS. I tried using Createfile, Virtual Alloc and Readfile
functions but i am not able to read the FAT. I have administrator rights
and there is no question of violation of security.How else could i read
the FAT.
Also i want to read files given sector numbers and not just filenames,
is this possible with MfC's. Any help would be greatly appreciated.
Thanking you in advance,
Sethi J
----------------------------------------------------------------------
_)_)_)_)_)_) _)_)_)_)_) JANARDAN SETHI
_) _) Residence:
_) _) 51 1/2 Market Street
_) _)_)_)_)_) Apt #9, Potsdam
_) _) NY-13676 U.S.A
_) _) _) Hello: 315-268-1824
_)_) _)_)_)_)_) e-mail:sethijr@craft.clarkson.edu
Mike Blaszczak -- mikeblas@nwlink.com
Tuesday, December 10, 1996
At 12:36 12/8/96 -0500, Janardan R. Sethi wrote:
> Environment: VC++ 4.0 Windows NT 4.0
> My application requires that i read the file allocation table(FAT) of
>the WinNT OS. I tried using Createfile, Virtual Alloc and Readfile
>functions but i am not able to read the FAT. I have administrator rights
>and there is no question of violation of security.How else could i read
>the FAT.
What happens when the drive in question is NTFS or FAT-32? They have
different formats, and you'll need to write lots of special-case code.
What happened when you used CreateFile()? It _is_ possible to read all
portions of the physical disk if you properly use CreateFile() to open
the device name.
> Also i want to read files given sector numbers and not just filenames,
>is this possible with MfC's. Any help would be greatly appreciated.
MFC doesn't support this sort of tomfoolery. Few people really need to
do it, and the people who do really need to do it are smart enough to write
it for themselves.
"Reading files given sector numbers" doesn't make much sense to me.
On disk, a file is just a logical collection of data that lives on different
disk sectors and is united by entries in some lookup tables. It seems like
what you're really driving at is the code that performs those lookups and
decides what given sector might be a part of what file. The operating
system, nor MFC, provide code to do this. You actually need to traverse
the entire drive's directory tree and look at related entries in the FAT
as you go: on large or crowded volumes, that can take a very long time.
.B ekiM
http://www.nwlink.com/~mikeblas/ <-- trip report central!
95 Honda VFR-750F / 88 Yamaha FZ-700 (damaged) / 94 Mazda RX-7
Serial #00050! / AMA - HRC - VFROC / Wang Dang Wankel
I am bored of this talk. It is time now for the dancing!
These words are my own - I do not speak on behalf of Microsoft.
| Вернуться в корень Архива
|