Namespaces

Variants
Actions

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

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: Den123 (27 Jun 2007)
Last edited: hamishwillee (30 May 2013)
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 30 May 2013, at 04:38.
48 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×