## FIL

The FIL structure (file object) holds state of an open file. It is initialzed 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 {
        FATFS*  fs;           /* Pointer to the owner file system object */
        WORD    id;           /* Owner file system mount ID */
        BYTE    flag;         /* File status flags */
        BYTE    csect;        /* Sector address in the cluster */
        DWORD   fptr;         /* File R/W pointer */
        DWORD   fsize;        /* File size */
        DWORD   org_clust;    /* File start cluster */
        DWORD   curr_clust;   /* Current cluster */
        DWORD   dsect;        /* Current data sector */
    #if _FS_READONLY == 0
        DWORD   dir_sect;     /* Sector containing the directory entry */
        BYTE*   dir_ptr;      /* Ponter to the directory entry in the window */
    #endif
    #if !_FS_TINY
        BYTE    buf[SS_MAX];  /* File R/W buffer */
    #endif
    } FIL;

Return