--- a/javacommons/fileutils/src/nativefileiohandler.cpp Wed Sep 15 12:05:25 2010 +0300
+++ b/javacommons/fileutils/src/nativefileiohandler.cpp Wed Oct 13 14:23:59 2010 +0300
@@ -18,8 +18,6 @@
#include <errno.h>
#include <fcntl.h>
#include <locale.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <unistd.h>
#include <string>
@@ -179,6 +177,19 @@
closeStream();
}
+void NativeFileIOHandler::flush()
+{
+ JELOG2(EJavaFile);
+ int ret = fsync(mFileDescriptor);
+ if (ret < 0)
+ {
+ ELOG1(EJavaFile, "NativeFileIOHandler::flush() error %d", ret);
+ int error = errno;
+ throw error;
+ }
+
+}
+
void NativeFileIOHandler::closeStream()
{
JELOG2(EJavaFile);