|Jan 21, 2005, 08:14 AM||#1|
raw reading hard disk on mac
I want to raw read the hard disk sector on mac using xcode c++ project.I am using following code for that
#define _LARGEFILE64_SOURCE //FOR READING LARGE CAPACITY HARD disk
#define _FILE_OFFSET_BITS 64
FILE * pFile;
unsigned char * buffer;
pFile = fopen ( "/dev/disk1" , "rb" );
if (pFile==NULL) exit (1);
fseeko(pFile ,(off_t)1826*512, SEEK_SET);
// copy the file into the buffer.
/*** the whole file is loaded in the buffer. ***/
pFile = fopen ("myfile.doc" , "wb+");
fwrite (buffer , 512 ,1, pFile);
But in some cases i found that readed sector have different values that actual values. Plz if there is any other function for reading and writing or other way then plz help me to sought out my problem.
|Jan 28, 2005, 07:39 PM||#2|
I'm in a rush as I write this, but you might want to look into the xnu system call meta_bread() to read each block into a buf, set a semaphore, modify it, unlock it, then sync it back to disk. When I get more time I'll post some details.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Using a G4 iMac hard disk in a Power Mac G4 (Digital Audio)||Jethryn Freyman||PowerPC Macs||5||Aug 6, 2011 02:58 AM|
|2TB WD Caviar Green hard disk for Power Mac G5||Jethryn Freyman||PowerPC Macs||3||Jul 16, 2011 08:04 AM|
|Authenticate My Application to Raw read hard disk on Tiger??||naveen||Mac Programming||6||Oct 25, 2005 02:49 AM|
|READING OF HARD DISK ON MAC OS||naveen||Mac Programming||5||Oct 29, 2004 01:19 PM|
All times are GMT -5. The time now is 08:13 AM.