Re: [Dev-C++] How to read/write directly a track/sector in a hard disk or CD
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2005-08-29 19:45:07
|
Security from snooping? That is done by strong encryption. Security from data loss? That is done by journaling or similar for power failures and mirrored or check-summed data to handle hardware failures. Data recovery? Journaling, ECC, check-sum, mirroring or similar.. Reasons for thinking about direct access - or for intercepting driver accesses might be: - extremely high-end database using custom-optimized file system. - cryptographic layer doing sector-by-sector encryption. - routing layer for faking a local harddrive over the network. - storage manager layer for glueing multiple drives dynamically or statically into larger drives. - software RAID. - support for foreign file systems natively or in "user mode". - repartitioning drives, growing/shrinking/converting file systems. - media rotation layer for supporting media with limited write counts. - repair of broken file system. - ... Most of above cases exists for free or almost free, or are so very out of scope for real use that it isn't economical to develop a solution unless the target application can be sold for _big_ sums of money. www.sysinternals.com have some nice articles about file systems and how to build your own disk defragger for example. Anyway, to be able to give reasonable help/recommendations it very much helps to know the why. A lot of people ask very specific questions about problems that are not relevant. What use is it to help them to fix a bug in an incorrectly chosen algorithm instead of telling them which algorithm they should have used? The quality of expected answers very much depends on the quality of the question. /Per W On Mon, 29 Aug 2005, Alfred P. Reaud wrote: > IMHO, there are many reasons for doing such, including security, data recovery, etc. However, I've never seen this done in C/C++. As you have to access low level IO functions, this is preferentially done is assembly, as I don't believe C/C++ have this capability. At least, I've never found the need to research it. > > I would recommend Googling for low level disk IO. If you're really diligent, you can find out that there are undocumented features to disk controllers that significantly enhance data security. > > Per Westermark <pw...@ia...> wrote: > Since reading/wringing directly to the drive requires access to the > physical hardware, I have to ask exactly why you have this need. What are > you trying to do? > > /Per W > > On Mon, 29 Aug 2005, rc...@bi... wrote: > > > > > Dear sir, > > > > I see how to read/write to files using C. But I need to to define a track/sector that I can read and write to it under my control. Could > > you help me pointing out documents/sites with this information or teatching me how to do this. > > > > Thanks for your help > > > > Roger > <snip> > > > > > Alfred P. Reaud > > > |