- if( Node->ImplInt & FAT_FLAG_DIRTY ) {\r
- #if 0\r
- // Write back\r
- FAT_int_UpdateDirEntry(\r
- Node->Inode >> 32, Node->ImplInt & 0xFFFF,\r
- Node\r
- );\r
- #endif\r
+ // Update the node if it's dirty (don't bother if it's marked for\r
+ // deletion)\r
+ if( Node->ImplInt & FAT_FLAG_DIRTY && !(Node->ImplInt & FAT_FLAG_DELETE) )\r
+ {\r
+ tFAT_VolInfo buf[16];\r
+ tFAT_VolInfo *ft = &buf[ (Node->ImplInt & 0xFFFF) % 16 ];\r
+ \r
+ FAT_int_ReadDirSector(Node, (Node->ImplInt & 0xFFFF)/16, buf);\r
+ ft->size = Node->Size;\r
+ // TODO: update adate, mtime, mdate\r
+ FAT_int_WriteDirEntry(Node, Node->ImplInt & 0xFFFF, ft);\r
+ \r
+ Node->ImplInt &= ~FAT_FLAG_DIRTY;\r