×
Namespaces

Variants
Actions

How to get file system drive information using Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search

This article shows how to use RFs::DriveList() to get an array containing a bitmap of attributes for all drives.

Article Metadata
Compatibility
Platform(s): All Symbian
Device(s): All Symbian
Platform Security
Signing Required: Self-Signed
Capabilities: None
Article
Created: vasant21 (30 May 2007)
Reviewed: hamishwillee (02 Feb 2012)
Last edited: hamishwillee (02 Feb 2012)

Code snippet

The drive list consists of an array of 26 bytes. Array index 0 corresponds to drive A, 1 equals B etc. The array member value is a bitmap of drive attributes, or 0 if there is no such drive. The following code prints each drive in the drive list as a letter, followed by the hex value of the integer indicating the drive's attributes.

#include <f32file.h>
TDriveList drivelist;
TChar driveLetter; TInt driveNumber=EDriveA;
_LIT(KDrive,"%c: %02x ");
User::LeaveIfError(fsSession.DriveList(drivelist));
 
for(;driveNumber<=EDriveZ;driveNumber++)
{
if (drivelist[driveNumber])
{
User::LeaveIfError(fsSession.DriveToChar(driveNumber,driveLetter));
console->Printf(KDrive, TUint(driveLetter), drivelist[driveNumber]);
}
}
This page was last modified on 2 February 2012, at 06:46.
70 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×