The FIL structure holds state of a file and it is allocated by an application program. Only buffer member can be initialized by the application program.
typedef struct _FIL {
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; // Pointer to 512 byte file R/W buffer
BYTE flag; // File status flags
BYTE sect_clust; // Left sectors in current cluster
} FIL;
typedef struct _FIL {
DWORD fptr; // File R/W pointer
DWORD fsize; // File size
WORD org_clust; // File start cluster
WORD 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 flag; // File status flags
BYTE sect_clust; // Left sectors in current cluster
} FIL;