Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <f32file.h>
Link against: efsrv.lib

Class RFormat

class RFormat : public RSubSessionBase;

Description

Formats a device, one step at a time.

RFormat must first be opened on a device before formatting each track using Next().

There is also an asynchronous version of Next() which, if encapsulated into a suitable active object, can be used to implement a user-interruptible formatting process.

Derivation

Members

Defined in RFormat:

Inherited from RSubSessionBase:


Member functions


Open()

Capability: DiskAdmin

IMPORT_C TInt Open(RFs &aFs, const TDesC &aName, TUint aFormatMode, TInt &aCount);

Description

Opens a device for formatting.

The device may be formatted either at high or low density.

Devices which support read-only media may not be formatted. This includes the ROM on drive Z:. All files on the drive must be closed otherwise an error is returned.

Parameters

RFs &aFs

The file server session. Must be connected.

const TDesC &aName

The drive to be formatted, specified as a drive letter followed by a colon.

TUint aFormatMode

The format mode. See TFormatMode.

TInt &aCount

On successful return, contains the number of tracks which remain to be formatted. This value is passed to the first iteration of Next(), which then decrements the value on this and subsequent calls to Next().

Return value

TInt

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

See also:


Open()

Capability: DiskAdmin

IMPORT_C TInt Open(RFs &aFs, const TDesC &aName, TUint aFormatMode, TInt &aCount, const TDesC8 &anInfo);

Description

Opens a device for formatting. User can specify new format parameters by anInfo.

The device may be formatted either at high or low density.

Devices which support read-only media may not be formatted. This includes the ROM on drive Z:. All files on the drive must be closed otherwise an error is returned.

Parameters

RFs &aFs

The file server session. Must be connected.

const TDesC &aName

The drive to be formatted, specified as a drive letter followed by a colon.

TUint aFormatMode

The format mode. See TFormatMode.

TInt &aCount

On successful return, contains the number of tracks which remain to be formatted. This value is passed to the first iteration of Next(), which then decrements the value on this and subsequent calls to Next().

const TDesC8 &anInfo

Special format information specified by user.

Return value

TInt

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

See also:


Close()

IMPORT_C void Close();

Description

Closes the Format subsession.

Any open files are closed when the file server session is closed.

Close() is guaranteed to return, and provides no indication whether it completed successfully or not.


Next()

Capability: DiskAdmin

IMPORT_C TInt Next(TInt &aStep);

Description

Executes the next format step.

This is a synchronous function, which returns when the formatting step is complete.

Parameters

TInt &aStep

The step number. On return, it is decremented to indicate what stage the formatting has reached. Before the first call to this function, this value is seeded with the number of tracks remaining to be formatted as returned by RFormat::Open(). The function should be called repeatedly until aStep reaches zero.

Return value

TInt

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


Next()

Capability: DiskAdmin

IMPORT_C void Next(TPckgBuf< TInt > &aStep, TRequestStatus &aStatus);

Description

Executes the next format step.

This is an asynchronous function.

Parameters

TPckgBuf< TInt > &aStep

The step number. On return, it is decremented to indicate what stage the formatting has reached. Before the first call to this function, this value is seeded with the number of tracks remaining to be formatted as returned by RFormat::Open(). The function should be called repeatedly until aStep reaches zero.

TRequestStatus &aStatus

The request status. On request completion, contains a completion code: KErrNone, if successful, otherwise one of the other system-wide error codes.