Checking the Availability of Memory

This section explains the System Utility functionality of checking the disk space.

Perform one or more of the following steps based on the requirements:

Steps

  • To check whether the disk space is below the critical level in FFS (also called the system drive), call FFSSpaceBelowCriticalLevelL() function.
  • To check whether the disk space is below the critical level in MMC storage, call MMCSpaceBelowCriticalLevelL() function.
  • To check whether the disk space is below the critical level on a disk drive, call DiskSpaceBelowCriticalLevelL() function.

Results

The functions return ETrue if the number of bytes to be written takes the memory below the critical level, else returns EFalse.

Example

The following is an code fragment illustrating how to check whether the disk space is below critical level:

TInt dataSize = 500;
if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFsSession, dataSize, EDriveC ) )
    {
    // Cannot write the data, there's not enough free space on disk.
    ...     
    }
else
    {
    // It's ok to actually write the data.
    ...
    }

Related concepts