diff --git a/src/fs/io/FileOutputStream.cxx b/src/fs/io/FileOutputStream.cxx index 082ca2fe8..0ee62a092 100644 --- a/src/fs/io/FileOutputStream.cxx +++ b/src/fs/io/FileOutputStream.cxx @@ -33,6 +33,12 @@ FileOutputStream::FileOutputStream(Path _path, Mode _mode) :path(_path), mode(_mode) +{ + Open(); +} + +inline void +FileOutputStream::Open() { switch (mode) { case Mode::CREATE: diff --git a/src/fs/io/FileOutputStream.hxx b/src/fs/io/FileOutputStream.hxx index 1f6a34ccf..a17350adc 100644 --- a/src/fs/io/FileOutputStream.hxx +++ b/src/fs/io/FileOutputStream.hxx @@ -133,6 +133,7 @@ public: private: void OpenCreate(bool visible); void OpenAppend(bool create); + void Open(); bool Close() noexcept { assert(IsDefined());