🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages Started by Babak Sat, 03 Jun 2006 19:31
FAT32 is my problem
#3487
Author: Babak
Date: Sat, 03 Jun 2006 19:31
29 lines
1889 bytes
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
  }
}
Re: FAT32 is my problem
#3488
Author: Ed Mulroy
Date: Sun, 04 Jun 2006 01:32
45 lines
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
>  }
> }
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads