Namespaces
Variants
Actions

How to check disk drive storage space

Jump to: navigation, search
Article Metadata

Article
Created: Den123 (27 Jun 2007)
Last edited: hamishwillee (26 Jul 2012)
Checks if free disk drive storage space is or will fall below critical level using class SysUtil.
static IMPORT_C TBool SysUtil::DiskSpaceBelowCriticalLevelL  (  
RFs * aFs,
TInt aBytesToWrite,
TInt aDrive
)

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.

Example:

TInt dataSize = 500;
if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFsSession, dataSize, EDriveC ) )
{
// Can not write the data, there's not enough free space on disk.
...
}
else
{
// 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).


Internal Links:

This page was last modified on 26 July 2012, at 05:38.
96 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved