Skip to content

Commit

Permalink
FileSystem: Partial revert of c82f800
Browse files Browse the repository at this point in the history
Mixing stdio and raw FD access is a bad thing, filelength() isn't going to return correct results when extending a file has been buffered.
  • Loading branch information
stenzek committed Aug 2, 2023
1 parent 31029b2 commit 68ad3e8
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions common/FileSystem.cpp
Expand Up @@ -748,13 +748,6 @@ s64 FileSystem::FTell64(std::FILE* fp)

s64 FileSystem::FSize64(std::FILE* fp)
{
#ifdef _WIN32
const int fd = _fileno(fp);
if (fd >= 0)
{
return _filelengthi64(fd);
}
#else
const s64 pos = FTell64(fp);
if (pos >= 0)
{
Expand All @@ -765,7 +758,6 @@ s64 FileSystem::FSize64(std::FILE* fp)
return size;
}
}
#endif

return -1;
}
Expand Down

0 comments on commit 68ad3e8

Please sign in to comment.