I am using a native library which creates and writes to a binary file(a network logging file) with fopen(). I am using this library on both android and windows. On Android, the file is not deleted & created upon calling fopen(), while it is so on windows. This is troublesome because I want it to be reset everytime I start the program; as it is now, the logger just accumulate data when I run it on android.
I fopen() the file like this;
#ifdef ANDROID
pcapFP = fopen("/mnt/sdcard/log.pcap","wb+");
#else
pcapFP = fopen("log.pcap","wb+");
#endif
Any idea why the Android file dosn't reset?
Thanks
EDIT: It seems that if the process is killed, then the file is reset upon restarting the app however. This is not good enough however, I want to reset it when I want with *fopen()/fclose().*