How to unlock a section of a large file.
RFile64::Unlock() allows a section of data within a file to be unlocked. This function uses 64-bit TInt64 variables rather than 32-bit TInt variables. The area to unlock within a file is specified by the starting position and length of the area. Using a 64-bit variable rather than a 32-bit variable allows the specified position and length of the section to be greater than 2GB-1.
// Replace RFile with RFile64 RFile64 file; TInt err = file.Open(TheFs, _L(“BIGFILE.BIG”), EFileWrite); if(err != KErrNone) { // handle unrelated error return err; } // Change the TInt type to TInt64 TInt64 lockPosition, lockLength; err = file.UnLock(lockPosition,lockLength); if(err != KErrNone) { //could return with KErrArgument if lockPosition + lockLength > 63Bytes 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.