Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fopen, fseek, fwrite for large files
Message
De
13/08/2007 22:20:40
 
 
À
13/08/2007 21:22:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01247944
Message ID:
01247949
Vues:
21
Hi Carlos.

I'm not sure what the problem is as Set Decimals does not alter how values are calculated, only how they are displayed.

The two values you are calculating look like thy should be the correct values to pass to the API.
You could try the following to calculate the low integer if you want, but I'd expect it to produce the same results as what you already have.
cpL=lDistanceToMove % 2^32

Ian Simcock.


>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.aspx
>
>The 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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform