How to check disk drive storage space
Article Metadata
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:


(no comments yet)