Using RFormat

This topic describes how to format a device.

The RFormat class formats a device, one step at a time.

The object must first be opened on a device, and then each track is formatted using Next(). The following code fragment shows how this is done:

...
_LIT(KDriveA,"A:");
...
RFs fs;
User::LeaveIfError(fs.Connect());
...
RFormat format;
TInt tracksRemaining;
User::LeaveIfError(format.Open(fs,KDriveA,EHighDensity,tracksRemaining));
while (tracksRemaining)
    {
    User::LeaveIfError(format.Next(tracksRemaining));
    }
format.Close();