From f6479b00d63121a294d1d443f5ea269245eb0fec Mon Sep 17 00:00:00 2001 From: ahodgkinson Date: Thu, 13 Jul 2006 21:18:46 +0000 Subject: [PATCH] FTK change. Need to force a flush when a write extends a file without calling extendFile. git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@667 0109f412-320b-0410-ab79-c3e0c5ffbbe6 --- ftk/src/ftkwin.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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) {