javacommons/fileutils/src/nativefileiohandler.cpp
changeset 78 71ad690e91f5
parent 49 35baca0e7a2e
child 87 1627c337e51e
equal deleted inserted replaced
72:1f0034e370aa 78:71ad690e91f5
   177     JELOG2(EJavaFile);
   177     JELOG2(EJavaFile);
   178     mWritePosition = -1;
   178     mWritePosition = -1;
   179     closeStream();
   179     closeStream();
   180 }
   180 }
   181 
   181 
       
   182 void NativeFileIOHandler::flush()
       
   183 {
       
   184     JELOG2(EJavaFile);
       
   185     int ret = fsync(mFileDescriptor);
       
   186     if (ret < 0)
       
   187     {
       
   188         ELOG1(EJavaFile, "NativeFileIOHandler::flush() error %d", ret);
       
   189         int error = errno;
       
   190         throw error;
       
   191     }
       
   192 
       
   193 }
       
   194 
   182 void NativeFileIOHandler::closeStream()
   195 void NativeFileIOHandler::closeStream()
   183 {
   196 {
   184     JELOG2(EJavaFile);
   197     JELOG2(EJavaFile);
   185     if ((-1 == mReadPosition) && (-1 == mWritePosition))
   198     if ((-1 == mReadPosition) && (-1 == mWritePosition))
   186     {
   199     {