Reading a Section of a Large File

How to read a section of a large file.

The function RFs::ReadFileSection() uses a TInt64 to specify position an a large file that is beyond 2GB–1.

See RFs::ReadFileSection(const TDesC& aName, TInt64 aPos, TDes8& aDes, TInt aLength).

Replace the TInt variable with a TInt64 or specify the position value.
TFileName filename = _L(“BIGFILE.BIG”);
TBuf<1024> readBuf;
    
// TInt position = 3000;
TInt64 position = 3000000000;

TInt r = iFs.ReadFileSection(filename, position, readBuf, readBuf.Length());