The FIL structure (file object) holds state of an open 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 except for cltbl. Note that a sector buffer is defined in this structure under non-tiny configuration so that the FIL structures should not be defined as auto variable.

typedef struct {
    FATFS*  fs;           /* Pointer to the owner file system object */
    WORD    id;           /* Owner file system mount ID */
    BYTE    flag;         /* File status flags */
    BYTE    pad1;
    DWORD   fptr;         /* File read/write pointer (Byte offset origin from top of the file) */
    DWORD   fsize;        /* File size */
    DWORD   sclust;       /* File start cluster */
    DWORD   clust;        /* Current cluster */
    DWORD   dsect;        /* Current data sector */
    DWORD   dir_sect;     /* Sector containing the directory entry */
    BYTE*   dir_ptr;      /* Ponter to the directory entry in the window */
    DWORD*  cltbl;        /* Pointer to the cluster link map table (Nulled on file open) */
    UINT    lockid;       /* File lock ID */
#if !_FS_TINY
    BYTE    buf[_MAX_SS]; /* Data read/write buffer */
} FIL;