I am trying to code replacement functions to FOPEN, FCLOSE, FSEEK, etc, that work with large files (>4gb)
I have found this example:
Calling the Windows APIs for Large Files
http://blogs.msdn.com/calvin_hsia/comments/398749.aspxThe problem is that I want to use SetFilePointerEx, I understand that I have to "split" the liDistanceToMove LARGE_INTEGER parameter into two 4 byte numbers, the problem is this code:
cpH=INT(lDistanceToMove/2^32)
cpL=lDistanceToMove - cpH * 2^32
This depends on the SET DECIMALS setting, and at the default, for example 4294967295 / 2^32 yields 1, so I have to do:
m.lnOldDecimals = Set("Decimals")
Set Decimals To 18
m.lnHigh = Int(lDistanceToMove / 2^32)
Set Decimals To (m.lnOldDecimals)
I bet there must be a more elegant way to do this, I tried for example:
Bitrshift(lDistanceToMove, 32)
But of course it does not work.
Carlos Alloatti