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 over the next few weeks. Thanks for all your past and future contributions.
How to check disk drive storage space
static IMPORT_C TBool SysUtil::DiskSpaceBelowCriticalLevelL (
RFs * aFs,
Include header: sysutil.h Link against: sysutil.lib
aFs - File server session. Must be given if available, e.g. from EIKON environment. If NULL, this method will create a temporary session, which causes the method to consume more time and system resources.
aBytesToWrite - Number of bytes the caller is about to write to disk. If value 0 is given, this method checks if the current disk space is already below critical level.
aDrive - Identifies the disk drive to be checked. Numeric values for identifying disk drives are defined in TDriveNumber enumeration.
TInt dataSize = 500;
if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFsSession, dataSize, EDriveC ) )
// Can not write the data, there's not enough free space on disk.
// It's ok to actually write the data.
Warning Note that this method, and all methods in SysUtil return -46 (KErrPermissionDenied) on some firmware versions of the Nokia N80 (see Archived:SysUtil API does not work in Nokia N80 (Known Issue) for more).