Is there any special that needs to be done or taken into consideration when directly opening a block device (such as a HDD)?
Does the normal fopen
and/or std::fstream
(and their related tell
/seek
/read
/write
functions), or do special functions/classes have to be used?
Do they allow truly random seeking, or is there a strict limiting to reading whole blocks at a time? If the former, is there a significant performance penalty to not doing block-wise reading (compared to the same sorts of reads of a file on a "regular" filesystem)?
This will be on OS-X and, in the near future, other POSIX-based OSes (with the Linux kernel, not the BSD kernel), primarily using stl
classes when available.