Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
How to check free space on memory card
This snippet shows how the application can check whether there is enough free space on a memory card before attempting to save a file.
//necessary header file
//open RFs session
//freeSpace will store number of free memory card in Bytes
//Contains drive information.
//check all drives from A to Z
for (TInt driveNumber=EDriveA; driveNumber<=EDriveZ; driveNumber++)
//Gets information of this drive
//if this drive is EMediaNANDFlash,we find drive of Memory card
// also reported my DiBo Members that on some devices it can be EMediaHardDisk
// ref: [http://www.developer.nokia.com/Community/Discussion/showthread.php?156990-Free-system-memory]
if(driveInfo.iType == EMediaNANDFlash)
//recode its free space in bytes
freeKBytes = volumeInfo.iFree/1024;
//close RFs session
The freeSpace variable the free memory space in bytes, on the memory card.