RFile64 Class Reference

#include <f32file64.h>

Link against: efsrv.lib

class RFile64 : public RFile

Inherits from

Public Member Functions
EFSRV_IMPORT_C TIntAdoptFromClient(const RMessage2 &, TInt, TInt)
EFSRV_IMPORT_C TIntAdoptFromCreator(TInt, TInt)
EFSRV_IMPORT_C TIntAdoptFromServer(TInt, TInt)
EFSRV_IMPORT_C TIntCreate(RFs &, const TDesC &, TUint)
EFSRV_IMPORT_C TIntLock(TInt64, TInt64)
EFSRV_IMPORT_C TIntOpen(RFs &, const TDesC &, TUint)
TInt Read(TDes8 &)
voidRead(TDes8 &, TRequestStatus &)
TInt Read(TDes8 &, TInt)
voidRead(TDes8 &, TInt, TRequestStatus &)
EFSRV_IMPORT_C TIntRead(TInt64, TDes8 &)
EFSRV_IMPORT_C voidRead(TInt64, TDes8 &, TRequestStatus &)
EFSRV_IMPORT_C TIntRead(TInt64, TDes8 &, TInt)
EFSRV_IMPORT_C voidRead(TInt64, TDes8 &, TInt, TRequestStatus &)
EFSRV_IMPORT_C TIntRead(TUint, TDes8 &)
EFSRV_IMPORT_C voidRead(TUint, TDes8 &, TRequestStatus &)
EFSRV_IMPORT_C TIntRead(TUint, TDes8 &, TInt)
EFSRV_IMPORT_C voidRead(TUint, TDes8 &, TInt, TRequestStatus &)
TInt Read(TInt, TDes8 &)
voidRead(TInt, TDes8 &, TRequestStatus &)
TInt Read(TInt, TDes8 &, TInt)
voidRead(TInt, TDes8 &, TInt, TRequestStatus &)
EFSRV_IMPORT_C TIntReplace(RFs &, const TDesC &, TUint)
EFSRV_IMPORT_C TIntSeek(TSeek, TInt64 &)
EFSRV_IMPORT_C TIntSetSize(TInt64)
EFSRV_IMPORT_C TIntSize(TInt64 &)
EFSRV_IMPORT_C TIntTemp(RFs &, const TDesC &, TFileName &, TUint)
EFSRV_IMPORT_C TIntUnLock(TInt64, TInt64)
TInt Write(const TDesC8 &)
voidWrite(const TDesC8 &, TRequestStatus &)
TInt Write(const TDesC8 &, TInt)
voidWrite(const TDesC8 &, TInt, TRequestStatus &)
EFSRV_IMPORT_C TIntWrite(TInt64, const TDesC8 &)
EFSRV_IMPORT_C voidWrite(TInt64, const TDesC8 &, TRequestStatus &)
EFSRV_IMPORT_C TIntWrite(TInt64, const TDesC8 &, TInt)
EFSRV_IMPORT_C voidWrite(TInt64, const TDesC8 &, TInt, TRequestStatus &)
EFSRV_IMPORT_C TIntWrite(TUint, const TDesC8 &)
EFSRV_IMPORT_C voidWrite(TUint, const TDesC8 &, TRequestStatus &)
EFSRV_IMPORT_C TIntWrite(TUint, const TDesC8 &, TInt)
EFSRV_IMPORT_C voidWrite(TUint, const TDesC8 &, TInt, TRequestStatus &)
TInt Write(TInt, const TDesC8 &)
voidWrite(TInt, const TDesC8 &, TRequestStatus &)
TInt Write(TInt, const TDesC8 &, TInt)
voidWrite(TInt, const TDesC8 &, TInt, TRequestStatus &)
Inherited Functions
RFile::Adopt(RFs &,TInt)
RFile::Att(TUint &)const
RFile::BlockMap(SBlockMapInfo &,TInt64 &,TInt64,TInt)const
RFile::ChangeMode(TFileMode)
RFile::Clamp(RFileClamp &)
RFile::Close()
RFile::CloseSubSession(TInt)
RFile::CreateSubSession(const RSessionBase &,TInt,const TIpcArgs &)
RFile::Drive(TInt &,TDriveInfo &)const
RFile::Duplicate(const RFile &,TOwnerType)
RFile::DuplicateHandle(TInt &)const
RFile::Flush()
RFile::Flush(TRequestStatus &)
RFile::FullName(TDes &)const
RFile::Lock(TInt,TInt)const
RFile::Modified(TTime &)const
RFile::Name(TDes &)const
RFile::ReadCancel()const
RFile::ReadCancel(TRequestStatus &)const
RFile::Rename(const TDesC &)
RFile::SendReceive(TInt,const TIpcArgs &)const
RFile::Set(const TTime &,TUint,TUint)
RFile::SetAtt(TUint,TUint)
RFile::SetModified(const TTime &)
RFile::SetSize(TInt)
RFile::TransferToClient(const RMessage2 &,TInt)const
RFile::TransferToProcess(RProcess &,TInt,TInt)const
RFile::TransferToServer(TIpcArgs &,TInt,TInt)const
RFile::UnLock(TInt,TInt)const
RSubSessionBase::CreateAutoCloseSubSession(RSessionBase &,TInt,const TIpcArgs &)
RSubSessionBase::CreateSubSession(const RSessionBase &,TInt)
RSubSessionBase::RSubSessionBase()
RSubSessionBase::Send(TInt)const
RSubSessionBase::Send(TInt,const TIpcArgs &)const
RSubSessionBase::SendReceive(TInt)const
RSubSessionBase::SendReceive(TInt,TRequestStatus &)const
RSubSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSubSessionBase::Session()const
RSubSessionBase::SubSessionHandle()const

Detailed Description

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 Open() to open an existing file for reading or writing; an error is returned if it does not already exist. To open an existing file for reading only, use Open() with an access mode of EFileRead, and a share mode of EFileShareReadersOnly.

  • 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

Member Function Documentation

AdoptFromClient ( const RMessage2 &, TInt, TInt )

EFSRV_IMPORT_C TIntAdoptFromClient(const RMessage2 &aMsg,
TIntaFsHandleIndex,
TIntaFileHandleIndex
)

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.

ParameterDescription
aMsgThe message received from the client
aFsHandleIndexThe index that identifies the message slot of a file server session (RFs) handle
aFileHandleIndexThe 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.

AdoptFromCreator ( TInt, TInt )

EFSRV_IMPORT_C TIntAdoptFromCreator(TIntaFsIndex,
TIntaFileHandleIndex
)

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.

ParameterDescription
aFsIndexAn index that identifies the slot in the process environment data that contains the file server session (RFs) handle
aFileHandleIndexAn 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.

AdoptFromServer ( TInt, TInt )

EFSRV_IMPORT_C TIntAdoptFromServer(TIntaFsHandle,
TIntaFileHandle
)

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.

ParameterDescription
aFsHandleThe file server session (RFs) handle
aFileHandleThe file (RFile) handle of the already opened file

Returns: KErrNone if successful, otherwise one of the other system-wide error codes.

Create ( RFs &, const TDesC &, TUint )

EFSRV_IMPORT_C TIntCreate(RFs &aFs,
const TDesC &aName,
TUintaFileMode
)

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

capability
Dependent If the path in aName starts with /Sys then capability Tcb is required
capability
Dependent If the path in aName starts with /Resource then capability Tcb is required
capability
Dependent If the path in aName starts with /Private and does not match this process' SID then AllFiles capability is required.
ParameterDescription
aFsThe file server session.
aNameThe 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.
aFileModeThe 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.

Lock ( TInt64, TInt64 )

EFSRV_IMPORT_C TIntLock(TInt64aPos,
TInt64aLength
)const

Open ( RFs &, const TDesC &, TUint )

EFSRV_IMPORT_C TIntOpen(RFs &aFs,
const TDesC &aName,
TUintaFileMode
)

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

capability
Dependent If the path for aName is /Sys and aMode is neither EFileShareReadersOnly nor EFileRead then Tcb capability is required.
capability
Dependent If the path for aName is /Sys and aMode is either EFileShareReadersOnly or EFileRead then Allfiles capability is required.
capability
Dependent If the path for aName begins with /Private and does not match this process' SID then AllFiles capability is required.
capability
Dependent If the path for aName begins with /Resource and aMode is neither EFileShareReadersOrWriters|EFileRead nor EFileShareReadersOnly nor EFileRead then Tcb capability is required.
ParameterDescription
aFsThe file server session.
aNameThe 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.
aFileModeThe mode in which the file is opened. See TFileMode.

Returns: KErrNone if successful, otherwise one of the other system-wide error codes.

Read ( TDes8 & )

TInt Read(TDes8 &aDes)const [inline]

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

ParameterDescription
aDesDescriptor 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.

Read ( TDes8 &, TRequestStatus & )

voidRead(TDes8 &aDes,
TRequestStatus &aStatus
)const [inline]

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

ParameterDescription
aDesDescriptor 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.
aStatusRequest status. On completion contains: KErrNone, if successful, otherwise one of the other system-wide error codes.

Read ( TDes8 &, TInt )

TInt Read(TDes8 &aDes,
TIntaLength
)const [inline]

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.

ParameterDescription
aDesDescriptor into which binary data is read. Any existing contents are overwritten. On return, its length is set to the number of bytes read.
aLengthThe 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.

Read ( TDes8 &, TInt, TRequestStatus & )

voidRead(TDes8 &aDes,
TIntaLength,
TRequestStatus &aStatus
)const [inline]

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.

ParameterDescription
aDesDescriptor 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.
aLengthThe 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.
aStatusRequest status. On completion contains KErrNone if successful, otherwise one of the other system-wide error codes.

Read ( TInt64, TDes8 & )

EFSRV_IMPORT_C TIntRead(TInt64aPos,
TDes8 &aDes
)const

Read ( TInt64, TDes8 &, TRequestStatus & )

EFSRV_IMPORT_C voidRead(TInt64aPos,
TDes8 &aDes,
TRequestStatus &aStatus
)const

Read ( TInt64, TDes8 &, TInt )

EFSRV_IMPORT_C TIntRead(TInt64aPos,
TDes8 &aDes,
TIntaLength
)const

Read ( TInt64, TDes8 &, TInt, TRequestStatus & )

EFSRV_IMPORT_C voidRead(TInt64aPos,
TDes8 &aDes,
TIntaLength,
TRequestStatus &aStatus
)const

Read ( TUint, TDes8 & )

EFSRV_IMPORT_C TIntRead(TUintaPos,
TDes8 &aDes
)const

Read ( TUint, TDes8 &, TRequestStatus & )

EFSRV_IMPORT_C voidRead(TUintaPos,
TDes8 &aDes,
TRequestStatus &aStatus
)const

Read ( TUint, TDes8 &, TInt )

EFSRV_IMPORT_C TIntRead(TUintaPos,
TDes8 &aDes,
TIntaLength
)const

Read ( TUint, TDes8 &, TInt, TRequestStatus & )

EFSRV_IMPORT_C voidRead(TUintaPos,
TDes8 &aDes,
TIntaLength,
TRequestStatus &aStatus
)const

Read ( TInt, TDes8 & )

TInt Read(TIntaPos,
TDes8 &aDes
)const [inline]

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

panic
FSCLIENT 19 if aPos is negative.
ParameterDescription
aPosPosition 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.
aDesThe 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.

Read ( TInt, TDes8 &, TRequestStatus & )

voidRead(TIntaPos,
TDes8 &aDes,
TRequestStatus &aStatus
)const [inline]

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

panic
FSCLIENT 19 if aPos is negative.
ParameterDescription
aPosPosition 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.
aDesThe 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.
aStatusThe request status. On completion, contains an error code of KErrNone if successful, otherwise one of the other system-wide error codes.

Read ( TInt, TDes8 &, TInt )

TInt Read(TIntaPos,
TDes8 &aDes,
TIntaLength
)const [inline]

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

panic
FSCLIENT 19 if aPos is negative.
ParameterDescription
aPosPosition 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.
aDesThe descriptor into which binary data is read. Any existing contents are overwritten. On return, its length is set to the number of bytes read.
aLengthThe 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.

Read ( TInt, TDes8 &, TInt, TRequestStatus & )

voidRead(TIntaPos,
TDes8 &aDes,
TIntaLength,
TRequestStatus &aStatus
)const [inline]

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

panic
FSCLIENT 19 if aPos is negative.
ParameterDescription
aPosPosition 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.
aDesThe 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.
aLengthThe 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.
aStatusRequest status. On completion contains KErrNone if successful, otherwise one of the other system-wide error codes.

Replace ( RFs &, const TDesC &, TUint )

EFSRV_IMPORT_C TIntReplace(RFs &aFs,
const TDesC &aName,
TUintaFileMode
)

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

capability
Dependent If the path in aName starts with /Sys then capability Tcb is required
capability
Dependent If the path in aName starts with /Resource then capability Tcb is required
capability
Dependent If the path in aName starts with /Private and does not match this process' SID then AllFiles capability is required.
ParameterDescription
aFsThe file server session.
aNameThe 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.
aFileModeThe 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.

Seek ( TSeek, TInt64 & )

EFSRV_IMPORT_C TIntSeek(TSeekaMode,
TInt64 &aPos
)const

SetSize ( TInt64 )

EFSRV_IMPORT_C TIntSetSize(TInt64aSize)

Size ( TInt64 & )

EFSRV_IMPORT_C TIntSize(TInt64 &aSize)const

Temp ( RFs &, const TDesC &, TFileName &, TUint )

EFSRV_IMPORT_C TIntTemp(RFs &aFs,
const TDesC &aPath,
TFileName &aName,
TUintaFileMode
)

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

capability
Dependent If aPath starts with /Sys then capability Tcb is required
capability
Dependent If aPath starts with /Resource then capability Tcb is required
capability
Dependent If aPath starts with /Private and does not match this process' SID then AllFiles capability is required.
ParameterDescription
aFsThe file server session.
aPathThe directory in which the file is created.
aNameOn return, contains the full path and file name of the file. The filename is guaranteed to be unique within the directory specified by aPath.
aFileModeThe 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.

UnLock ( TInt64, TInt64 )

EFSRV_IMPORT_C TIntUnLock(TInt64aPos,
TInt64aLength
)const

Write ( const TDesC8 & )

TInt Write(const TDesC8 &aDes)[inline]

Reimplemented from RFile::Write(const TDesC8 &)

Writes to the file at the current offset within the file.

This is a synchronous function.

ParameterDescription
aDesThe 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.

Write ( const TDesC8 &, TRequestStatus & )

voidWrite(const TDesC8 &aDes,
TRequestStatus &aStatus
)[inline]

Writes to the file at the current offset within the file.

This is an asynchronous function.

ParameterDescription
aDesThe 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.
aStatusRequest status. On completion contains KErrNone if successful, otherwise one of the other system-wide error codes.

Write ( const TDesC8 &, TInt )

TInt Write(const TDesC8 &aDes,
TIntaLength
)[inline]

Writes a portion of a descriptor to the file at the current offset within the file.

This is a synchronous function.

panic
FSCLIENT 27 in debug mode, if aLength is greater than the length of the descriptor aDes.
ParameterDescription
aDesThe descriptor from which binary data is written.
aLengthThe 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.

Write ( const TDesC8 &, TInt, TRequestStatus & )

voidWrite(const TDesC8 &aDes,
TIntaLength,
TRequestStatus &aStatus
)[inline]

Writes a portion of a descriptor to the file at the current offset within the file.

This is an asynchronous function.

ParameterDescription
aDesThe 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.
aLengthThe 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.
aStatusRequest status. On completion contains KErrNone if successful; KErrArgument if aLength is negative; otherwise one of the other system-wide error codes.

Write ( TInt64, const TDesC8 & )

EFSRV_IMPORT_C TIntWrite(TInt64aPos,
const TDesC8 &aDes
)

Write ( TInt64, const TDesC8 &, TRequestStatus & )

EFSRV_IMPORT_C voidWrite(TInt64aPos,
const TDesC8 &aDes,
TRequestStatus &aStatus
)

Write ( TInt64, const TDesC8 &, TInt )

EFSRV_IMPORT_C TIntWrite(TInt64aPos,
const TDesC8 &aDes,
TIntaLength
)

Write ( TInt64, const TDesC8 &, TInt, TRequestStatus & )

EFSRV_IMPORT_C voidWrite(TInt64aPos,
const TDesC8 &aDes,
TIntaLength,
TRequestStatus &aStatus
)

Write ( TUint, const TDesC8 & )

EFSRV_IMPORT_C TIntWrite(TUintaPos,
const TDesC8 &aDes
)

Write ( TUint, const TDesC8 &, TRequestStatus & )

EFSRV_IMPORT_C voidWrite(TUintaPos,
const TDesC8 &aDes,
TRequestStatus &aStatus
)

Write ( TUint, const TDesC8 &, TInt )

EFSRV_IMPORT_C TIntWrite(TUintaPos,
const TDesC8 &aDes,
TIntaLength
)

Write ( TUint, const TDesC8 &, TInt, TRequestStatus & )

EFSRV_IMPORT_C voidWrite(TUintaPos,
const TDesC8 &aDes,
TIntaLength,
TRequestStatus &aStatus
)

Write ( TInt, const TDesC8 & )

TInt Write(TIntaPos,
const TDesC8 &aDes
)[inline]

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)

panic
FSCLIENT 19 if aPos is negative.
ParameterDescription
aPosThe 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.
aDesThe 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.

Write ( TInt, const TDesC8 &, TRequestStatus & )

voidWrite(TIntaPos,
const TDesC8 &aDes,
TRequestStatus &aStatus
)[inline]

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)

panic
FSCLIENT 19 if aPos is negative.
ParameterDescription
aPosThe 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.
aDesThe 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.
aStatusRequest status. On completion contains KErrNone if successful, otherwise one of the other system-wide error codes.

Write ( TInt, const TDesC8 &, TInt )

TInt Write(TIntaPos,
const TDesC8 &aDes,
TIntaLength
)[inline]

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)

panic
FSCLIENT 19 if aPos is negative.
ParameterDescription
aPosThe 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.
aDesThe descriptor from which binary data is written.
aLengthThe 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.

Write ( TInt, const TDesC8 &, TInt, TRequestStatus & )

voidWrite(TIntaPos,
const TDesC8 &aDes,
TIntaLength,
TRequestStatus &aStatus
)[inline]

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)

panic
FSCLIENT 19 if aPos is negative.
ParameterDescription
aPosThe 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.
aDesThe 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.
aLengthThe number of bytes to be written from aDes. It must not be negative.
aStatusRequest status. On completion contains KErrNone if successful; KErrArgument if aLength is negative; otherwise one of the other system-wide error codes.