/*
Brief
dump data to file/將資料寫入檔案中
*/
int dump_data_to_file(char *name, unsigned int add, unsigned int size)
{
FILE *DstPtr = NULL;
char *SrcPtr = (char *)(add);
//DETAIL("copy name:%s, address:%8d, size:%4d\n", name, add, size);
if ((DstPtr = fopen(name,"a+b")) == NULL){
ERR("Can't open file %s!!\n", name);
return -1;
}
else{
fwrite(SrcPtr, size, 1, DstPtr);
}
fclose(DstPtr);
return 0;
}
全站熱搜
留言列表