diff --git a/ftk/src/ftkwin.cpp b/ftk/src/ftkwin.cpp index 73ec1ac..354e86e 100644 --- a/ftk/src/ftkwin.cpp +++ b/ftk/src/ftkwin.cpp @@ -518,6 +518,21 @@ RCODE F_FileHdl::lowLevelWrite( } } } + else + { + if( RC_BAD( rc = size( &ui64CurrFileSize))) + { + goto Exit; + } + + if( ui64CurrFileSize <= ui64WriteOffset + uiBytesToWrite) + { + // The file is being extended. We must force a flush + // to ensure that the directory entry is updated. + + m_bFlushRequired = TRUE; + } + } if( !pvBuffer) {