bin_file_open_append.cpp 554 B

12345678910111213141516171819202122
  1. //
  2. // $Id$
  3. //
  4. #include<__vic/bin_file.h>
  5. #include<__vic/windows/throw_last_error.h>
  6. #include<windows.h>
  7. namespace __vic {
  8. //----------------------------------------------------------------------------
  9. bool bin_file::open_append(const char *fname)
  10. {
  11. if(!open_(fname, GENERIC_WRITE, append)) return false;
  12. if(::SetFilePointer(hFile, 0, 0, FILE_END) == INVALID_SET_FILE_POINTER)
  13. windows::throw_last_error("SetFilePointer");
  14. return true;
  15. }
  16. //----------------------------------------------------------------------------
  17. } // namespace