diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-19E4573B-3561-5BD0-862C-DC6392A968EC.dita --- a/Symbian3/PDK/Source/GUID-19E4573B-3561-5BD0-862C-DC6392A968EC.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-19E4573B-3561-5BD0-862C-DC6392A968EC.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,31 +1,31 @@ - - - - - -Changes to File Server BehaviourThis document describes the behaviour changes of APIs that have been made 64-bit aware. The signature of these APIs has not changed but the change in their behaviour may impact existing applications.

If you wish to use large files with your application and you are using some of these functions check that the changes in behaviour described here do not cause your application to fail.

Note: if your legacy application opens a file in shared write mode, another application can make it large using the 64-bit APIs. If your application is affected you should:

Clients that do not migrate need to ensure they handle the error KErrTooBig:

RFile::Read()

There are four RFile::Read() overload functions that can perform a read from the current file position these functions can read from a position beyond 2GB–1:

  • RFile::Read(TDes8& aDes)

  • RFile::Read(TDes8& aDes, TRequestStatus& - aStatus)

  • RFile::Read(TDes8& aDes, TInt aLength)

  • RFile::Read(TDes8& aDes, TInt aLength, - TRequestStatus& aStatus).

Verify that your application can handle reads greater than 2GB. For example, This example shows a counter variable accumulating the number of bytes. As this can be more than 2GB the counter should be of type TInt64.

TInt r; - RFile file; - // Replace TInt variable with TInt64 variable - // TInt bytesRead = 0; - TInt64 bytesRead = 0; - TBuf8<4096> readBuf; - ... - // Read loop - FOREVER - { - // Read a block - r = file.Read(readBuf); - if(KErrNone != r) - { - // Error handling - break; - } + + + + + +Changes to File Server BehaviourThis document describes the behaviour changes of APIs that have been made 64-bit aware. The signature of these APIs has not changed but the change in their behaviour may impact existing applications.

If you wish to use large files with your application and you are using some of these functions check that the changes in behaviour described here do not cause your application to fail.

  • RFile::Read()

  • RFile::Seek()

  • RFile::Size()

  • CDir::Sort()

  • RDir::GetDir()

  • CFileMan::Copy()

  • CFileMan::Move().

Note: if your legacy application opens a file in shared write mode, another application can make it large using the 64-bit APIs. If your application is affected you should:

  • enable 64-bit file support to allow access to files beyond the 2GBytes boundary

  • migrate to using TInt64 offsets

  • migrate to the RFile::Seek64() and RFile::Size64() APIs.

Clients that do not migrate need to ensure they handle the error KErrTooBig:

  • RFile::Read() - this function will return KErrTooBig if the read position goes beyond 2GB-1.

  • RFile::Seek() - this function will return KErrTooBig if the 64-bit Seek() function seeks to a location greater than 2GB-1.

  • RFile::Size() - this function will return the lower 32-bits of the file size and KErrTooBig.

RFile::Read()

There are four RFile::Read() overload functions that can perform a read from the current file position these functions can read from a position beyond 2GB–1:

  • RFile::Read(TDes8& aDes)

  • RFile::Read(TDes8& aDes, TRequestStatus& + aStatus)

  • RFile::Read(TDes8& aDes, TInt aLength)

  • RFile::Read(TDes8& aDes, TInt aLength, + TRequestStatus& aStatus).

Verify that your application can handle reads greater than 2GB. For example, This example shows a counter variable accumulating the number of bytes. As this can be more than 2GB the counter should be of type TInt64.

TInt r; + RFile file; + // Replace TInt variable with TInt64 variable + // TInt bytesRead = 0; + TInt64 bytesRead = 0; + TBuf8<4096> readBuf; + ... + // Read loop + FOREVER + { + // Read a block + r = file.Read(readBuf); + if(KErrNone != r) + { + // Error handling + break; + } bytesRead += readBuf.Length();
RFile::Seek()

RFile::Seek() has not been altered to handle large files. The table below describes the behaviour for the different seek modes as defined in TMode.

Seek mode

New behaviour

ESeekAddress

No change in behaviour

ESeekStart

Can seek up to 2GB–1

ESeekCurrent

If the current position is less than 2GB–1 and the expected position is less than 2GB–1, then the current file pointer is moved, the output parameter is updated with the new file position and KErrNone is returned.

If either the current position or the expected position is more than 2GB–1, seek fails with the error code KErrTooBig and the output parameter is not modified.

ESeekEnd

If the current position is less than 2GB–1 and the expected position is less than 2GB–1, then the current file pointer is moved and the output parameter is updated with the new file position and KErrNone is returned.

If either the current position or the expected position is more than 2GB–1, seek fails with the error code KErrTooBig and the output parameter is not modified.

To handle large files use RFile::Seek64() instead of RFile::Seek(). See Seeking a Position in a Large File.

RFile::Size()

If the file is less than 2GB-1 RFile::Size() behaves as usual and returns KErrNone with the size of the file. If the file is larger than 2GB–1 the function returns KErrTooBig and the lower 32 bits of the file size is returned.

To handle files larger than 2GB-1 use the function RFile::Size64(). See Getting the Size of a Large File.

CRir::Sort()

CRir::Sort() has been enhanced so that it can handle the sorting by size of large directory entries. No change is required to applications currently using this function.

Note: sort by size is limited to 4GB-1.

RDir::GetDir()

The implementation of the three overload functions for RDir::GetDir() has been updated so that these functions can correctly sort directory entries by size. No change is required to applications currently using this function.

Note: sort by size is limited to 4GB-1.

CFileMan::Copy()

CFileMan::Copy() copies a large file to any location on the same drive or to any location on a different drive. If the target drive does not support large files the function returns the error KErrTooBig.

No change is required to applications currently using this function.

CFileMan::Move()

CFileMan::Move() moves a file to any location on the same drive or a different drive. If the target drive does not support large files the function returns the error KErrTooBig.

No change is required to applications currently using this function.

\ No newline at end of file