Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FSEEK Files over 2 gig
Message
Information générale
Forum:
Visual C++
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01241740
Message ID:
01242072
Vues:
17
>>Hi all,
>>
>>Trying some very simple reading of a large xml file over 2 gig... in its simplest form...
>>
>>// open the file
>>fopen( FileHandle, cNameOfFile )
>>
>>// advance to the end of the file...
>>fseek( FileHandle, 0L, SEEK_END )
>>
>>I get a -1 on the call to FSEEK indicating an error...
>>
>>What I'm trying to do is just get a verification at the end of the file looking for what should be a valid closing XML tag info... So what I want is to just skip back about 20 characters from the end of the file and return the last 20 characters...
>>
>>I would have expected to do something as simple as
>>
>>fseek( FileHandle, -20L, SEEK_END )
>>
>>then
>>fread( FileHandle, sizeof( char ), 20, MyBuffer )
>>
>>
>>Am I missing something stupid, or is it just something associated with files over 2 gig...
>
>Try to use _fseek64() function.

Good point! I didn't realise that it was C++ question originally, but with your help I found

http://www.codeproject.com/file/64-bit_fileio.asp
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform