-[NSFleHandle_win32 offsetInFile] implemented

This commit is contained in:
Christopher Lloyd 2008-02-11 15:01:35 +00:00
parent a00972020f
commit 58b02671b7

View File

@ -98,8 +98,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
-(unsigned long long)offsetInFile {
NSUnimplementedMethod();
return 0;
LARGE_INTEGER li;
li.QuadPart=0;
li.LowPart=SetFilePointer(_handle,li.LowPart,&li.HighPart,FILE_CURRENT);
if(li.LowPart==INVALID_SET_FILE_POINTER && GetLastError()!=NO_ERROR)
[NSException raise:NSInvalidArgumentException format:@"GetLastError()=%d",GetLastError()];
return li.QuadPart;
}
-(void)seekToFileOffset:(unsigned long long)offset {