4 #include <msp/core/systemerror.h>
5 #include <msp/strings/format.h>
7 #include "handle_private.h"
14 void File::platform_init(const string &fn, CreateMode cm)
19 case M_READ: flags |= O_RDONLY; break;
20 case M_WRITE: flags |= O_WRONLY; break;
21 case M_RDWR: flags |= O_RDWR; break;
41 *handle = ::open(fn.c_str(), flags, 0666);
46 throw file_not_found(fn);
48 throw file_already_exists(fn);
50 throw system_error(format("open(%s)", fn), err);
56 signal_flush_required.emit();