In e2studio (Synergy project), when I read a .txt file from emmc I put all the data in a structure in RAM and when I write, I copy all the data of the structure in the file. So the .txt file and the structure contains the same quantity of data.
What I need to do now is use a bigger .txt file (so the data in the file are more than the data that the structure contains), from which I want to read only a part of it and put the data in the same structure I already use.
I should read the data in the file from a specified position (an offset) instead of from the beginning. Is it possible?
In the same way, I need to write the data of the structure in a specified position in the file instead of from the beginning.
These are the functions that I am using now:
char nameFile_ReportCycle = "Report_cycle.txt";FX_FILE g_file_report_cycle;struct TypeReportCycle ReportCycle[NUM_CYCLE];
#define fx_file_read _fxe_file_read#define fx_file_write _fxe_file_write
fx_file_read(&g_file_list_cycle, &ListCycle, sizeof(struct TypeListCycle)*(NUM_CYCLE), &tmp);fx_file_write(&g_file_report_cycle, &ReportCycle, sizeof(struct TypeReportCycle) * NUM_CYCLE);
If you really want to read and write files, you should go Synergy community and ask about using FileX.However you just would like to use file data in your program, you could static link files…
Solved. Thank you.
I hope Okra's answer help you with this. Were you able to read/write to a file from a specified point now? Please confirm so that we can close this thread now. Thank you!
JBRenesasRulz Forum Moderator