bin_file_write.cpp 425 B

1234567891011121314151617181920
  1. //
  2. // $Id$
  3. //
  4. #include<__vic/bin_file.h>
  5. #include<__vic/error.h>
  6. #include<cstdio>
  7. namespace __vic {
  8. //----------------------------------------------------------------------------
  9. void bin_file::write_all(const void *buf, size_t n)
  10. {
  11. if(std::fwrite(buf, 1, n , f) != n)
  12. throw exception("I/O error: write failed");
  13. }
  14. //----------------------------------------------------------------------------
  15. } // namespace