Convert ReadOnlyTest to fileStream

This commit is contained in:
obligaron 2021-05-10 00:27:45 +02:00 committed by Anders Jenbo
commit ddde5e41a3

View file

@ -5,6 +5,7 @@
*/
#include "appfat.h"
#include "utils/file_util.h"
#include "utils/paths.h"
namespace devilution {
@ -16,12 +17,11 @@ namespace devilution {
void ReadOnlyTest()
{
const std::string path = paths::PrefPath() + "Diablo1ReadOnlyTest.foo";
FILE *f = fopen(path.c_str(), "wt");
if (f == nullptr) {
auto fileStream = CreateFileStream(path.c_str(), std::ios::in | std::ios::out);
if (fileStream->fail()) {
DirErrorDlg(paths::PrefPath().c_str());
}
fclose(f);
remove(path.c_str());
}