mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 00:59:18 +01:00
fix for when file open is successful but the path isn't a file (#220)
FSC and indirectly coreinit relies on FileStream open failing for directories
This commit is contained in:
parent
76313fc238
commit
045a059742
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user