sam want
sam want

Reputation: 1

Write data into the file on the disk and then fonud file's md5 is not write?

it happens in the android client and it's Small probability.the code just like this:

bool WriteAndVerify(unsigned char* pvData,int dwLength){


if (!FileVerifyData(pvData,1 dwLength))
{
    return false;
}
if (!fwrite(pvData,1, dwLength,stream))
{
 return false;
}
//fflush(); no fllush
}

the code is very simple ,verify and write.but in small probability the final file is broken.i compare the final file to the right file,they have 64k or 128k bit data difference.and the wrong data looks like other's proccess's data.

my question :any posibility can cause this? it just happen in android,i found a android phone is HuaWei and it has external TF Card.

the buffer length is 16K,i have two idea: 1.any the other buffer stack overflow,and fllush my data 2.maybe physics address map into virtual addrees system wrong in two TF card phone

Upvotes: 0

Views: 49

Answers (0)

Related Questions