The FIL structure (file object) holds state of a file. It is created by f_open function and discarded by f_close function. There is no member that can be changed by the application program.
typedef struct _FIL { WORD id; /* Owner file system mount ID (inverted) */ BYTE flag; /* File status flags */ BYTE sect_clust; /* Left sectors in cluster */ FATFS* fs; /* Pointer to the owner file system object */ DWORD fptr; /* File R/W pointer */ DWORD fsize; /* File size */ DWORD org_clust; /* File start cluster */ DWORD curr_clust; /* Current cluster */ DWORD curr_sect; /* Current sector */ DWORD dir_sect; /* Sector containing the directory entry */ BYTE* dir_ptr; /* Ponter to the directory entry in the window */ BYTE buffer[512]; /* File R/W buffer */ } FIL;
typedef struct _FIL { WORD id; /* Owner file system mount ID (inverted) */ BYTE flag; /* File status flags */ BYTE sect_clust; /* Left sectors in cluster */ FATFS* fs; /* Pointer to owner file system */ DWORD fptr; /* File R/W pointer */ DWORD fsize; /* File size */ CLUST org_clust; /* File start cluster */ CLUST curr_clust; /* Current cluster */ DWORD curr_sect; /* Current sector */ DWORD dir_sect; /* Sector containing the directory entry */ BYTE* dir_ptr; /* Ponter to the directory entry in the window */ } FIL;