diff --git a/src/Common/unix/FileStream_unix.cpp b/src/Common/unix/FileStream_unix.cpp index b1e95ae9..08d2bc3d 100644 --- a/src/Common/unix/FileStream_unix.cpp +++ b/src/Common/unix/FileStream_unix.cpp @@ -198,6 +198,11 @@ FileStream::FileStream(const fs::path& path, bool isOpen, bool isWriteable) m_fileStream.open(path, std::ios_base::in | std::ios_base::out | std::ios_base::binary | std::ios_base::trunc); m_isValid = m_fileStream.is_open(); } + if(m_isValid && fs::is_directory(path)) + { + m_isValid = false; + m_fileStream.close(); + } } void FileStream::SyncReadWriteSeek(bool nextOpIsWrite)