From 64e6a53c0bb90e0cfcb454080af10f8b445bd0bb Mon Sep 17 00:00:00 2001 From: ponchio Date: Tue, 19 Oct 2004 16:52:49 +0000 Subject: [PATCH] Fixed windows files > 2Gb --- apps/nexus/file.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/nexus/file.cpp b/apps/nexus/file.cpp index a0c8ba2f..325bc042 100644 --- a/apps/nexus/file.cpp +++ b/apps/nexus/file.cpp @@ -59,8 +59,9 @@ void File::Redim(unsigned int elem) { if(elem > size) { #ifdef WIN32 + LONG zero = 0; if(INVALID_SET_FILE_POINTER == - SetFilePointer(fp, elem - 1, 0, FILE_BEGIN)) + SetFilePointer(fp, elem - 1, &zero, FILE_BEGIN)) #else if(-1 == fseek(fp, elem - 1, SEEK_SET)) #endif @@ -79,7 +80,8 @@ void File::Redim(unsigned int elem) { int fd = fileno(fp); ftruncate(fd, elem); #else - SetFilePointer(fp, elem, 0, FILE_BEGIN); + LONG zero = 0; + SetFilePointer(fp, elem, &zero, FILE_BEGIN); SetEndOfFile(fp); #endif } @@ -88,7 +90,8 @@ void File::Redim(unsigned int elem) { void File::SetPosition(unsigned int pos) { #ifdef WIN32 - SetFilePointer(fp, pos, 0, FILE_BEGIN); + LONG zero = 0; + SetFilePointer(fp, pos, &zero, FILE_BEGIN); #else fseek(fp, pos, SEEK_SET); #endif