Fix handling of large (>2GB) files on Windows. Egad, off_t is 32 bits on Windows, even in 64-bit Windows. Ridiculous.

This commit is contained in:
David Rose
2013-08-01 00:10:20 +00:00
parent 574199c94d
commit dba661253a
32 changed files with 150 additions and 79 deletions

View File

@@ -335,7 +335,7 @@ open_read_append_file(const Filename &file) {
// implementations may require this stream to determine
// the size.
////////////////////////////////////////////////////////////////////
off_t VirtualFileMountSystem::
streamsize VirtualFileMountSystem::
get_file_size(const Filename &file, istream *stream) const {
// First, save the original stream position.
streampos orig = stream->tellg();
@@ -364,7 +364,7 @@ get_file_size(const Filename &file, istream *stream) const {
// Description: Returns the current size on disk (or wherever it is)
// of the file before it has been opened.
////////////////////////////////////////////////////////////////////
off_t VirtualFileMountSystem::
streamsize VirtualFileMountSystem::
get_file_size(const Filename &file) const {
Filename pathname(_physical_filename, file);
return pathname.get_file_size();