You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GetFileSize API returns two DWORDs worth of size, for the low and high 32-bits of the file's actual 64-bit size. For some reason, errors are indicated by returning a low size of 0xffffffff and using SetLastError() to something other than NO_ERROR. But if the last error is NO_ERROR, that means the file really is 0xffffffff bytes long.
R3-Alpha doesn't check the error condition, hence it conflates errors with a legitimate size for a file to have (especially if it is growing incrementally bytes by bytes, to pass through such a size at some point).
(Pointing it out as a curiosity of API design more than anything. Issue is resolved in Ren-C by checking the error status, and if it is NO_ERROR then not reporting an error.)
Submitted by: Hostilefork
The GetFileSize API returns two DWORDs worth of size, for the low and high 32-bits of the file's actual 64-bit size. For some reason, errors are indicated by returning a low size of 0xffffffff and using SetLastError() to something other than NO_ERROR. But if the last error is NO_ERROR, that means the file really is 0xffffffff bytes long.
R3-Alpha doesn't check the error condition, hence it conflates errors with a legitimate size for a file to have (especially if it is growing incrementally bytes by bytes, to pass through such a size at some point).
https://github.com/rebol/rebol/blob/25033f897b2bd466068d7663563cd3ff64740b94/src/os/win32/dev-file.c#L348
(Pointing it out as a curiosity of API design more than anything. Issue is resolved in Ren-C by checking the error status, and if it is NO_ERROR then not reporting an error.)
Imported from: metaeducation#2282
Comments:
The text was updated successfully, but these errors were encountered: