#include <f32file64.h>
class RFile64 : public RFile |
Creates and opens a file, and performs all operations on a single open file.
This is equivalent to RFile class. This class is meant for accessing files of size greater than or equal to 2GB also.
These include:
reading from and writing to the file
seeking to a position within the file
locking and unlocking within the file
setting file attributes
Before using any of these services, a connection to a file server session must have been made, and the file must be open.
Opening Files:
use Create() to create and open a new file for writing; an error is returned if it already exists.
use Replace() to open a file for writing, replacing any existing file of the same name if one exists, or creating a new file if one does not exist. Note that if a file exists, its length is reset to zero.
use Temp() to create and open a temporary file with a unique name, for writing and reading.
When opening a file, you must specify the file server session to use for operations with that file. If you do not close the file explicitly, it is closed when the server session associated with it is closed.
Reading and Writing:
There are several variants of both Read() and Write(). The basic Read(TDes8& aDes) and Write(const TDesC8& aDes) are supplemented by variants allowing the descriptor length to be overridden, or the seek position of the first byte to be specified, or asynchronous completion, or any combination.
Reading transfers data from a file to a descriptor, and writing transfers data from a descriptor to a file. In all cases, the file data is treated as binary and byte descriptors are used (TDes8, TDesC8).
See also: RFile
EFSRV_IMPORT_C TInt | AdoptFromClient | ( | const RMessage2 & | aMsg, |
TInt | aFsHandleIndex, | |||
TInt | aFileHandleIndex | |||
) |
Reimplemented from RFile::AdoptFromClient(const RMessage2 &,TInt,TInt)
Allows a server to adopt an already open file from a client. The client's RFs and RFile handles are contained in message slots within aMsg.
Assumes that the client's RFs and RFile handles have been sent to the server using TransferToServer().
This RFile will own it's RFs session so that when the sub-session (RFile) is closed so will the RFs session.
Parameter | Description |
---|---|
aMsg | The message received from the client |
aFsHandleIndex | The index that identifies the message slot of a file server session (RFs) handle |
aFileHandleIndex | The index that identifies the message slot of the sub-session (RFile) handle of the already opened file |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
Reimplemented from RFile::AdoptFromCreator(TInt,TInt)
Allows a server to adopt an already open file from a client process. The client's file-server (RFs) and file (RFile) handles are contained in this process's environment data slots.
Assumes that the client's RFs and RFile handles have been sent to the server process using TransferToProcess().
This RFile will own it's RFs session so that when the sub-session (RFile) is closed so will the RFs session.
Parameter | Description |
---|---|
aFsIndex | An index that identifies the slot in the process environment data that contains the file server session (RFs) handle |
aFileHandleIndex | An index that identifies the slot in the process environment data that contains the sub-session (RFile) handle of the already opened file |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
Reimplemented from RFile::AdoptFromServer(TInt,TInt)
Allows a client to adopt an already open file from a server.
Assumes that the server's RFs and RFile handles have been sent to the client using TransferToClient().
This RFile will own it's RFs session so that when the sub-session (RFile) is closed so will the RFs session.
Parameter | Description |
---|---|
aFsHandle | The file server session (RFs) handle |
aFileHandle | The file (RFile) handle of the already opened file |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
Reimplemented from RFile::Create(RFs &,const TDesC &,TUint)
Creates and opens a new file for writing.
If the file already exists, an error is returned.
If the resulting path does not exist, then the operation cannot proceed and the function returns an error code.
Notes:
1. To close the file, use Close()
2. It automatically sets the file's archive attribute.
See also: TFileMode
Parameter | Description |
---|---|
aFs | The file server session. |
aName | The name of the file. Any path components (i.e. drive letter or directory), which are not specified, are taken from the session path. The file name shall not contain wild cards ('?' or '*' characters) and illegal characters like '<', '>', ':', '"', '/', '|' and ''. Backslash '\' character is allowed only as a path delimiter. The filename containing only white space characters (See TChar::IsSpace()) is also illegal. |
aFileMode | The mode in which the file is opened. The access mode is automatically set to EFileWrite. See TFileMode. |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
Reimplemented from RFile::Open(RFs &,const TDesC &,TUint)
Opens an existing file for reading or writing.
If the file does not already exist, an error is returned.
Notes:
1. To close the file, use Close()
2. Attempting to open a file with the read-only attribute using the EFileWrite access mode results in an error.
3. Attempting to open a file which is greater than or equal to 2GByte (2,147,483,648 bytes) will fail with KErrTooBig
4. After a file has been opened, the current write position is set to the start of the file. If necessary, use RFile::Seek() to move to a different position within the file.
See also: TFileMode
Parameter | Description |
---|---|
aFs | The file server session. |
aName | The name of the file. Any path components (i.e. drive letter or directory), which are not specified, are taken from the session path.The file name shall not contain wild cards ('?' or '*' characters) and illegal characters like '<', '>', ':', '"', '/', '|' and ''. Backslash '\' character is allowed only as a path delimiter. The filename containing only white space characters (See TChar::IsSpace()) is also illegal. |
aFileMode | The mode in which the file is opened. See TFileMode. |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
Reimplemented from RFile::Read(TDes8 &)const
Reads from the file at the current position.
This is a synchronous function.
Note that when an attempt is made to read beyond the end of the file, no error is returned. The descriptor's length is set to the number of bytes read into it. Therefore, when reading through a file,the end of file has been reached when the descriptor length, as returned by TDesC8::Length(), is zero.
See also: TDesC8::Length
Parameter | Description |
---|---|
aDes | Descriptor into which binary data is read. Any existing contents are overwritten. On return, its length is set to the number of bytes read. |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
void | Read | ( | TDes8 & | aDes, |
TRequestStatus & | aStatus | |||
) | const [inline] |
Reimplemented from RFile::Read(TDes8 &,TRequestStatus &)const
Reads from the file at the current position.
This is an asynchronous function.
Note that when an attempt is made to read beyond the end of the file, no error is returned. The descriptor's length is set to the number of bytes read into it. Therefore, when reading through a file,the end of file has been reached when the descriptor length, as returned by TDesC8::Length(), is zero.
See also: TDesC8::Length
Parameter | Description |
---|---|
aDes | Descriptor into which binary data is read. Any existing contents are overwritten. On return, its length is set to the number of bytes read. NB: this function is asynchronous and the request that it represents may not complete until some time after the call to the function has returned. It is important, therefore, that this descriptor remain valid, or remain in scope, until you have been notified that the request is complete. |
aStatus | Request status. On completion contains: KErrNone, if successful, otherwise one of the other system-wide error codes. |
Reimplemented from RFile::Read(TDes8 &,TInt)const
Reads the specified number of bytes of binary data from the file at the current position.
This is a synchronous function.
Note that when an attempt is made to read beyond the end of the file, no error is returned. The descriptor's length is set to the number of bytes read into it. Therefore, when reading through a file,the end of file has been reached when the descriptor length, as returned by TDesC8::Length(), is zero. Assuming aLength is less than the maximum length of the descriptor, the only circumstance in which Read() can return fewer bytes than requested, is when the end of file is reached or if an error occurs.
Parameter | Description |
---|---|
aDes | Descriptor into which binary data is read. Any existing contents are overwritten. On return, its length is set to the number of bytes read. |
aLength | The number of bytes to be read from the file into the descriptor. If an attempt is made to read more bytes than the descriptor's maximum length, the function returns KErrOverflow. This value must not be negative, otherwise the function returns KErrArgument. |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
void | Read | ( | TDes8 & | aDes, |
TInt | aLength, | |||
TRequestStatus & | aStatus | |||
) | const [inline] |
Reimplemented from RFile::Read(TDes8 &,TInt,TRequestStatus &)const
Reads a specified number of bytes of binary data from the file at the current position.
This is an asynchronous function.
Note that when an attempt is made to read beyond the end of the file, no error is returned. The descriptor's length is set to the number of bytes read into it. Therefore, when reading through a file, the end of file has been reached when the descriptor length, as returned by TDesC8::Length(), is zero. Assuming aLength is less than the maximum length of the descriptor, the only circumstances in which Read() can return fewer bytes than requested is when the end of file is reached or if an error has occurred.
Parameter | Description |
---|---|
aDes | Descriptor into which binary data is read. Any existing contents are overwritten. On return, its length is set to the number of bytes read. NB: this function is asynchronous and the request that it represents may not complete until some time after the call to the function has returned. It is important, therefore, that this descriptor remain valid, or remain in scope, until you have been notified that the request is complete. |
aLength | The number of bytes to be read from the file into the descriptor. If an attempt is made to read more bytes than the descriptor's maximum length, then the function updates aStatus parameter with KErrOverflow. It must not be negative otherwise the function updates aStatus with KErrArgument. |
aStatus | Request status. On completion contains KErrNone if successful, otherwise one of the other system-wide error codes. |
EFSRV_IMPORT_C void | Read | ( | TInt64 | aPos, |
TDes8 & | aDes, | |||
TRequestStatus & | aStatus | |||
) | const |
EFSRV_IMPORT_C void | Read | ( | TInt64 | aPos, |
TDes8 & | aDes, | |||
TInt | aLength, | |||
TRequestStatus & | aStatus | |||
) | const |
EFSRV_IMPORT_C void | Read | ( | TUint | aPos, |
TDes8 & | aDes, | |||
TRequestStatus & | aStatus | |||
) | const |
EFSRV_IMPORT_C void | Read | ( | TUint | aPos, |
TDes8 & | aDes, | |||
TInt | aLength, | |||
TRequestStatus & | aStatus | |||
) | const |
Reimplemented from RFile::Read(TInt,TDes8 &)const
Reads from the file at the specified offset within the file
This is a synchronous function.
Note that when an attempt is made to read beyond the end of the file, no error is returned. The descriptor's length is set to the number of bytes read into it. Therefore, when reading through a file, the end of file has been reached when the descriptor length, as returned by TDesC8::Length(), is zero.
Note: 1. This function over-rides the base class function RFile::Read and inlines the base class RFile::Read. 2. The difference is that this function can read beyond 2GB - 1 when aPos + length of aDes is beyond 2GB - 1. 3. This function is protected using _F32_STRICT_64_BIT_MIGRATION macro to help migration to 64 bit file addressing. When the macro is defined, this function becomes a private overload and hence use of TInt RFile64::Read(TInt64 aPos,TDes8& aDes) const is recommended.
See also: TInt RFile::Read(TInt aPos,TDes8& aDes) const TInt RFile64::Read(TInt64 aPos,TDes8& aDes) const
Parameter | Description |
---|---|
aPos | Position of first byte to be read. This is an offset from the start of the file. If no position is specified, reading begins at the current file position. If aPos is beyond the end of the file, the function returns a zero length descriptor. |
aDes | The descriptor into which binary data is read. Any existing content is overwritten. On return, its length is set to the number of bytes read. |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
void | Read | ( | TInt | aPos, |
TDes8 & | aDes, | |||
TRequestStatus & | aStatus | |||
) | const [inline] |
Reimplemented from RFile::Read(TInt,TDes8 &,TRequestStatus &)const
Reads from the file at the specified offset within the file.
This is an asynchronous function.
Note that when an attempt is made to read beyond the end of the file, no error is returned. The descriptor's length is set to the number of bytes read into it. Therefore, when reading through a file, the end of file has been reached when the descriptor length, as returned by TDesC8::Length(), is zero.
Note: 1. This function over-rides the base class function RFile::Read and inlines the base class RFile::Read. 2. The difference is that this function can read beyond 2GB - 1 when aPos + length of aDes is beyond 2GB - 1. 3. This function is protected using _F32_STRICT_64_BIT_MIGRATION macro to help migration to 64 bit file addressing. When the macro is defined, this function becomes a private overload and hence use of void RFile64::Read(TInt64 aPos,TDes8& aDes,TRequestStatus& aStatus) const is recommended.
See also: void RFile::Read(TInt aPos,TDes8& aDes,TRequestStatus& aStatus) const void RFile64::Read(TInt64 aPos,TDes8& aDes,TRequestStatus& aStatus) const
Parameter | Description |
---|---|
aPos | Position of first byte to be read. This is an offset from the start of the file. If no position is specified, reading begins at the current file position. If aPos is beyond the end of the file, the function returns a zero length descriptor. |
aDes | The descriptor into which binary data is read. Any existing content is overwritten. On return, its length is set to the number of bytes read. NB: this function is asynchronous and the request that it represents may not complete until some time after the call to the function has returned. It is important, therefore, that this descriptor remain valid, or remain in scope, until you have been notified that the request is complete. |
aStatus | The request status. On completion, contains an error code of KErrNone if successful, otherwise one of the other system-wide error codes. |
Reimplemented from RFile::Read(TInt,TDes8 &,TInt)const
Reads the specified number of bytes of binary data from the file at a specified offset within the file.
This is a synchronous function.
Note that when an attempt is made to read beyond the end of the file, no error is returned. The descriptor's length is set to the number of bytes read into it. Therefore, when reading through a file, the end of file has been reached when the descriptor length, as returned by TDesC8::Length(), is zero. Assuming aLength is less than the maximum length of the descriptor, the only circumstances in which Read() can return fewer bytes than requested is when the end of file is reached or if an error has occurred.
Note: 1. This function over-rides the base class function RFile::Read and inlines the base class RFile::Read. 2. The difference is that this function can read beyond 2GB - 1 when aPos + aLength is beyond 2GB - 1. 3. This function is protected using _F32_STRICT_64_BIT_MIGRATION macro to help migration to 64 bit file addressing. When the macro is defined, this function becomes a private overload and hence use of TInt RFile64::Read(TInt64 aPos,TDes8& aDes,TInt aLength) const is recommended.
See also: TInt RFile::Read(TInt aPos,TDes8& aDes,TInt aLength) const TInt RFile64::Read(TInt64 aPos,TDes8& aDes,TInt aLength) const
Parameter | Description |
---|---|
aPos | Position of first byte to be read. This is an offset from the start of the file. If no position is specified, reading begins at the current file position. If aPos is beyond the end of the file, the function returns a zero length descriptor. |
aDes | The descriptor into which binary data is read. Any existing contents are overwritten. On return, its length is set to the number of bytes read. |
aLength | The number of bytes to read from the file into the descriptor. If an attempt is made to read more bytes than the descriptor's maximum length, then the function updates aStatus parameter with KErrOverflow. It must not be negative otherwise the function updates aStatus with KErrArgument. |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
void | Read | ( | TInt | aPos, |
TDes8 & | aDes, | |||
TInt | aLength, | |||
TRequestStatus & | aStatus | |||
) | const [inline] |
Reimplemented from RFile::Read(TInt,TDes8 &,TInt,TRequestStatus &)const
Reads the specified number of bytes of binary data from the file at a specified offset within the file.
This is an asynchronous function.
Note that when an attempt is made to read beyond the end of the file, no error is returned. The descriptor's length is set to the number of bytes read into it. Therefore, when reading through a file, the end of file has been reached when the descriptor length, as returned by TDesC8::Length(), is zero. Assuming aLength is less than the maximum length of the descriptor, the only circumstances in which Read() can return fewer bytes than requested is when the end of file is reached or if an error has occurred.
Note: 1. This function over-rides the base class function RFile::Read and inlines the base class RFile::Read. 2. The difference is that this function can read beyond 2GB - 1 when aPos + aLength is beyond 2GB - 1. 3. This function is protected using _F32_STRICT_64_BIT_MIGRATION macro to help migration to 64 bit file addressing. When the macro is defined, this function becomes a private overload and hence use of void RFile64::Read(TInt64 aPos,TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const is recommended.
See also: void RFile::Read(TInt aPos,TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const void RFile64::Read(TInt64 aPos,TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const
Parameter | Description |
---|---|
aPos | Position of first byte to be read. This is an offset from the start of the file. If no position is specified, reading begins at the current file position. If aPos is beyond the end of the file, the function returns a zero length descriptor. |
aDes | The descriptor into which binary data is read. Any existing contents are overwritten. On return, its length is set to the number of bytes read. NB: this function is asynchronous and the request that it represents may not complete until some time after the call to the function has returned. It is important, therefore, that this descriptor remain valid, or remain in scope, until you have been notified that the request is complete. |
aLength | The number of bytes to read from the file into the descriptor. If an attempt is made to read more bytes than the descriptor's maximum length, then the function returns KErrOverflow. It must not be negative otherwise the function returns KErrArgument. |
aStatus | Request status. On completion contains KErrNone if successful, otherwise one of the other system-wide error codes. |
Reimplemented from RFile::Replace(RFs &,const TDesC &,TUint)
Opens a file for writing, replacing the content of any existing file of the same name if it exists, or creating a new file if it does not exist.
If the resulting path exists, then:
the length of an existing file with the same filename is re-set to zero
a new file is created, if no existing file with the same filename can be found.
If the resulting path does not exist, then the operation cannot proceed and the function returns an error code.
Notes:
To close the file, use Close(), defined in the base class RFsBase.
It automatically sets the file's archive attribute.
See also: TFileMode
Parameter | Description |
---|---|
aFs | The file server session. |
aName | The name of the file. Any path components (i.e. drive letter or directory), which are not specified, are taken from the session path. The file name shall not contain wild cards ('?' or '*' characters) and illegal characters like '<', '>', ':', '"', '/', '|' and ''. Backslash '\' character is allowed only as a path delimiter. The filename containing only white space characters (See TChar::IsSpace()) is also illegal. |
aFileMode | The mode in which the file is opened. The access mode is automatically set to EFileWrite. See TFileMode. |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
Reimplemented from RFile::Temp(RFs &,const TDesC &,TFileName &,TUint)
Creates and opens a temporary file with a unique name for writing and reading.
Notes:
1. To close the file, use Close()
See also: TFileMode
Parameter | Description |
---|---|
aFs | The file server session. |
aPath | The directory in which the file is created. |
aName | On return, contains the full path and file name of the file. The filename is guaranteed to be unique within the directory specified by aPath. |
aFileMode | The mode in which the file is opened. The access mode is automatically set to EFileWrite. See TFileMode. |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
Reimplemented from RFile::Write(const TDesC8 &)
Writes to the file at the current offset within the file.
This is a synchronous function.
Parameter | Description |
---|---|
aDes | The descriptor from which binary data is written. The function writes the entire contents of aDes to the file. |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
void | Write | ( | const TDesC8 & | aDes, |
TRequestStatus & | aStatus | |||
) | [inline] |
Reimplemented from RFile::Write(const TDesC8 &,TRequestStatus &)
Writes to the file at the current offset within the file.
This is an asynchronous function.
Parameter | Description |
---|---|
aDes | The descriptor from which binary data is written. The function writes the entire contents of aDes to the file. NB: this function is asynchronous and the request that it represents may not complete until some time after the call to the function has returned. It is important, therefore, that this descriptor remain valid, or remain in scope, until you have been notified that the request is complete. |
aStatus | Request status. On completion contains KErrNone if successful, otherwise one of the other system-wide error codes. |
Reimplemented from RFile::Write(const TDesC8 &,TInt)
Writes a portion of a descriptor to the file at the current offset within the file.
This is a synchronous function.
Parameter | Description |
---|---|
aDes | The descriptor from which binary data is written. |
aLength | The number of bytes to be written from the descriptor. This must not be greater than the length of the descriptor. It must not be negative. |
Returns: KErrNone if successful; KErrArgument if aLength is negative; otherwise one of the other system-wide error codes.
void | Write | ( | const TDesC8 & | aDes, |
TInt | aLength, | |||
TRequestStatus & | aStatus | |||
) | [inline] |
Reimplemented from RFile::Write(const TDesC8 &,TInt,TRequestStatus &)
Writes a portion of a descriptor to the file at the current offset within the file.
This is an asynchronous function.
Parameter | Description |
---|---|
aDes | The descriptor from which binary data is written. NB: this function is asynchronous and the request that it represents may not complete until some time after the call to the function has returned. It is important, therefore, that this descriptor remain valid, or remain in scope, until you have been notified that the request is complete. |
aLength | The number of bytes to be written from the descriptor. This must not be greater than the length of the descriptor. It must not be negative. |
aStatus | Request status. On completion contains KErrNone if successful; KErrArgument if aLength is negative; otherwise one of the other system-wide error codes. |
EFSRV_IMPORT_C void | Write | ( | TInt64 | aPos, |
const TDesC8 & | aDes, | |||
TRequestStatus & | aStatus | |||
) |
EFSRV_IMPORT_C void | Write | ( | TInt64 | aPos, |
const TDesC8 & | aDes, | |||
TInt | aLength, | |||
TRequestStatus & | aStatus | |||
) |
EFSRV_IMPORT_C void | Write | ( | TUint | aPos, |
const TDesC8 & | aDes, | |||
TRequestStatus & | aStatus | |||
) |
EFSRV_IMPORT_C void | Write | ( | TUint | aPos, |
const TDesC8 & | aDes, | |||
TInt | aLength, | |||
TRequestStatus & | aStatus | |||
) |
Reimplemented from RFile::Write(TInt,const TDesC8 &)
Writes to the file at the specified offset within the file
This is a synchronous function.
Note: 1. This function over-rides the base class function RFile::Write and inlines the base class RFile::Write. 2. The difference is that this function can write beyond 2GB - 1 when aPos + length of aDes is beyond 2GB - 1. 3. This function is protected using _F32_STRICT_64_BIT_MIGRATION macro to help migration to 64 bit file addressing. When the macro is defined, this function becomes a private overload and hence use of TInt RFile64::Write(TInt64 aPos,const TDesC8& aDes) is recommended.
See also: TInt RFile::Write(TInt aPos,const TDesC8& aDes) TInt RFile64::Write(TInt64 aPos,const TDesC8& aDes)
Parameter | Description |
---|---|
aPos | The offset from the start of the file at which the first byte is written. If a position beyond the end of the file is specified, then the write operation begins at the end of the file. If the position has been locked, then the write fails. |
aDes | The descriptor from which binary data is written. The function writes the entire contents of aDes to the file. |
Returns: KErrNone if successful, otherwise one of the other system-wide error codes.
void | Write | ( | TInt | aPos, |
const TDesC8 & | aDes, | |||
TRequestStatus & | aStatus | |||
) | [inline] |
Reimplemented from RFile::Write(TInt,const TDesC8 &,TRequestStatus &)
Writes to the file at the specified offset within the file
This is an asynchronous function.
Note: 1. This function over-rides the base class function RFile::Write and inlines the base class RFile::Write. 2. The difference is that this function can write beyond 2GB - 1 when aPos + length of aDes is beyond 2GB - 1. 3. This function is protected using _F32_STRICT_64_BIT_MIGRATION macro to help migration to 64 bit file addressing. When the macro is defined, this function becomes a private overload and hence use of void RFile64::Write(TInt64 aPos,const TDesC8& aDes,TRequestStatus& aStatus) is recommended.
See also: void RFile::Write(TInt aPos,const TDesC8& aDes,TRequestStatus& aStatus) void RFile64::Write(TInt64 aPos,const TDesC8& aDes,TRequestStatus& aStatus)
Parameter | Description |
---|---|
aPos | The offset from the start of the file at which the first byte is written. If a position beyond the end of the file is specified, then the write operation begins at the end of the file. If the position has been locked, then the write fails. |
aDes | The descriptor from which binary data is written. The function writes the entire contents of aDes to the file. NB: this function is asynchronous and the request that it represents may not complete until some time after the call to the function has returned. It is important, therefore, that this descriptor remain valid, or remain in scope, until you have been notified that the request is complete. |
aStatus | Request status. On completion contains KErrNone if successful, otherwise one of the other system-wide error codes. |
Reimplemented from RFile::Write(TInt,const TDesC8 &,TInt)
Writes the specified number of bytes to the file at the specified offset within the file.
This is a synchronous function.
Note: 1. This function over-rides the base class function RFile::Write and inlines the base class RFile::Write. 2. The difference is that this function can write beyond 2GB - 1 when aPos + aLength is beyond 2GB - 1. 3. This function is protected using _F32_STRICT_64_BIT_MIGRATION macro to help migration to 64 bit file addressing. When the macro is defined, this function becomes a private overload and hence use of TInt RFile64::Write(TInt64 aPos,const TDesC8& aDes,TInt aLength) is recommended.
See also: TInt RFile::Write(TInt aPos,const TDesC8& aDes,TInt aLength) TInt RFile64::Write(TInt64 aPos,const TDesC8& aDes,TInt aLength)
Parameter | Description |
---|---|
aPos | The offset from the start of the file at which the first byte is written. If a position beyond the end of the file is specified, then the write operation begins at the end of the file. If the position has been locked, then the write fails. |
aDes | The descriptor from which binary data is written. |
aLength | The number of bytes to be written from aDes . It must not be negative. |
Returns: KErrNone if successful; KErrArgument if aLength is negative; otherwise one of the other system-wide error codes.
void | Write | ( | TInt | aPos, |
const TDesC8 & | aDes, | |||
TInt | aLength, | |||
TRequestStatus & | aStatus | |||
) | [inline] |
Reimplemented from RFile::Write(TInt,const TDesC8 &,TInt,TRequestStatus &)
Writes the specified number of bytes to the file at the specified offset within the file.
This is an asynchronous function.
Note: 1. This function over-rides the base class function RFile::Write and inlines the base class RFile::Write. 2. The difference is that this function can write beyond 2GB - 1 when aPos + aLength is beyond 2GB - 1. 3. This function is protected using _F32_STRICT_64_BIT_MIGRATION macro to help migration to 64 bit file addressing. When the macro is defined, this function becomes a private overload and hence use of void RFile64::Write(TInt64 aPos,const TDesC8& aDes,TRequestStatus& aStatus) is recommended.
See also: void RFile::Write(TInt aPos,const TDesC8& aDes,TRequestStatus& aStatus) void RFile64::Write(TInt64 aPos,const TDesC8& aDes,TRequestStatus& aStatus)
Parameter | Description |
---|---|
aPos | The offset from the start of the file at which the first byte is written. If a position beyond the end of the file is specified, then the write operation begins at the end of the file. If the position has been locked, then the write fails. |
aDes | The descriptor from which binary data is written. NB: this function is asynchronous and the request that it represents may not complete until some time after the call to the function has returned. It is important, therefore, that this descriptor remain valid, or remain in scope, until you have been notified that the request is complete. |
aLength | The number of bytes to be written from aDes. It must not be negative. |
aStatus | Request status. On completion contains KErrNone if successful; KErrArgument if aLength is negative; otherwise one of the other system-wide error codes. |