- if(!(mode&M_WRITE))
- throw invalid_access(M_WRITE);
-
-#ifdef WIN32
- DWORD ret;
- if(!WriteFile(handle, buf, len, &ret, 0))
- throw system_error("WriteFile");
-#else
- int ret = ::write(handle, buf, len);
- if(ret==-1)
- throw system_error("write");
-#endif