Reading disk sectors directly in C/C++.
How do i directly read the disk sectors on my HDD in Turbo C/C++?I am working in win98 environment.'absread' or 'abswrite' gives 'Unknown error"
When i use F8 and get the machine into DOS,the error changes to "invalid function number".All this works fine when I change the drive to A: drive but not when i change it to C or D or E i.e HD drives.
Is there any function in VC++ which can give direct access to the HDD ?
Thanks in advance.
Re: Using inbuilt function ?
Quote:
Originally posted by someonenearHim
Thanks for the code.I will try to use it.But,why can't i use any inbuilt functions,after all roads leads to BIOS services !!!
That is in-built. That's how Turbo accesses the interrupts and disk.
What are you looking for? A function they wrote called
ReadAbsoluteDiskSector(buffer,drive,sector)?
If they had one, I might have used it. They didn't, so I had to supply it.
Where did 'file' come from ?
Hello,
I do not want to create or read any file directly from the HDD.I want to read the root directory of my HDD modify some values in it.I do not wish to create any handle to any file or directory.
Couldnt get the code to work
Hello WaltP,
You helpfully gave me the code but i could not get it to work.The compiler says that 'reg',setbuf' is not defined.And the character placed inside the intr() function is illegal(0xae). Can you(please ofcourse) give me the main() function which could use the GetSector() function ?
Quote:
Again, the problem is your crappy compiler (TC) - it's a museum piece - dump it and get something half decent
Can anybody suggest a better compiler for the DOS environment ?