How to seek a particular position in a large file.
The function RFile64::Seek() is the 64-bit version of RFile::Seek(). The Seek() function can modify the file pointer to point to any position addressable by the aPos parameter.
See RFile64::Seek(TSeek aMode, TInt64& aPos).
To get the current position of the file pointer, use the TSeek mode ESeekCurrent. The function updates the output parameter with the new file pointer position in 64-bits.
Different modes of operation can be specified. These modes are defined by TSeek.
If a large file seek is required, use RFile64::Seek() instead of RFile::Seek() and use a TInt64 value to specify the location.
// RFile file; RFile64 file; TInt err = file.Open(TheFs, _L(“BIGFILE.BIG”), EFileWrite); if(err != KErrNone) { // unrelated error return err; } // Large file access is now supported! // TInt seekPos = 0; Tint64 seekPos = 0; // Seek the current position. This can be greater than 2GB. err = file.Seek(ESeekEnd, seekPos); if(err != KErrNone) { return err; }
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.