Dear sir i have tried copying binary file of my firmware in to buffer but its not copying completely please help me in this
copying part of my code
Code:
if ((fp = fopen("/home/usb/FPR/firmware/fw.bix", "rb"))==NULL){
printf("Cannot open file \n");
}
int fileLen;
//Get file length
fseek(fp, 0, SEEK_END);
fileLen=ftell(fp);
fseek(fp, 0, SEEK_SET);
printf("\nfileLen = %d\n", fileLen);
fread(buf, fileLen, 1 ,fp);
cBuf = (const char*) buf;
int len = strlen(cBuf);
printf("\nBuf_len_aftr_Write = %d\n",len);
while(len!=0)
{
printf("%c", *cBuf);
len--;
}
int orglen = size;
printf("\n\n");
while(orglen!=0)
{
printf("%c", *buf);
orglen--;
}
fclose(fp);
thanks
rohaan