Article View: borland.public.cppbuilder.nativeapi
Article #3488Re: FAT32 is my problem
From: Ed Mulroy
Date: Sun, 04 Jun 2006 01:32
Date: Sun, 04 Jun 2006 01:32
45 lines
2460 bytes
2460 bytes
Look at the documentation on the function CreateFile. Look for
where it speaks of Physical Disks and Volumes.
Also look at the DeviceIoControl function and the IOCTL_* messages,
including IOCTL_DISK_GET_DRIVE_GEOMETRY_EX to get information which
will help in understanding where on the disk to look.
You can get that information from the platform SDK or from the
MSDN site:
http://msdn.microsoft.com/library/default.asp
. Ed
> Babak wrote in message
> news:4481f29e@newsgroups.borland.com...
> Hi
> when I was programming under DOS and FAT16 I was using this
> code to read sectors and store them into a file for future needs,
> now my partition are FAT32 and I stuck in Microsoft Windows ,
> Although I am using both 98 and XP but I have problem in both.
> My problem is I cant use absread() and abswrite() anymore, I
> dont know any function for my aim,...
> If anyone can help me to change this source code to a code that
> BCB5 could compile and I can use it for FAT32, please tell me ,
> thanks a milion :-)
>
> #include "stdio.h"
> #include "stdlib.h"
> #include "conio.h"
> #include "dos.h"
>
> #define SECTORS_PER_READ 16
> #define END_SECTOR 1000
> void main(void){
> int i, strt, ch_out, start_sector=0;
> char buf[512*SECTORS_PER_READ];
> if (absread(2, SECTORS_PER_READ, start_sector, &buf) != 0){
> perror("Read ABS from Disk Problem! Program Exit !");
> exit(1);
> }
> printf("Reading OK and going on...\n");
> for (i=0; i<END_SECTOR; i++){
> //do something like store in a file
> }
> }
Technical Details
Message-ID:
<44823837$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4481f29e@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a4bb98059ad52ee4 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Ed Mulroy" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.nativeapi References: <4481f29e@newsgroups.borland.com> Subject: Re: FAT32 is my problem Date: Sat, 3 Jun 2006 21:32:36 -0400 Lines: 47 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 69.242.35.97 Message-ID: <44823837$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1149384759 69.242.35.97 (3 Jun 2006 18:32:39 -0700) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news2.volia.net!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail