diff --git a/src/FileSink.cpp b/src/FileSink.cpp index 51afef6..1cb9f6c 100644 --- a/src/FileSink.cpp +++ b/src/FileSink.cpp @@ -53,14 +53,16 @@ FileSink::FileSink(AbsPathView filepath, Mode mode, Flags flags) noexcept { case Mode::CreateOrOpen: fmode |= fast_io::open_mode::creat; - // fall through + break; case Mode::Open: break; case Mode::CreateOrOpenAndClear: - fmode |= fast_io::open_mode::creat; - // fall through + //fmode |= fast_io::open_mode::creat; //cannot pass this, seems like a bug in fast_io. If it's passed, the mode reverts to OPEN_ALWAYS + fmode |= fast_io::open_mode::trunc; + break; case Mode::OpenAndClear: fmode |= fast_io::open_mode::trunc; + fmode |= fast_io::open_mode::excl; break; case Mode::CreateIfNew: fmode |= fast_io::open_mode::creat;