f_getfreespace


Use this function to fill a structure with information about the drive space usage: total space and free space.

Format

unsigned char f_getfreespace ( F_SPACE * sp )

Arguments

Argument Description Type
sp Where to write the F_SPACE structure. F_SPACE *

Return values

Return value Description
F_NOERR Successful execution.
Else See Error Codes.

Example

void info( void )
{
    F_SPACE space;
    unsigned char ret;

    /* Get free space on current drive */
    ret = f_getfreespace(space);
    if (!ret)
    {
        printf( "There are:\
        %d bytes total,\
        %d bytes free.",\
        space.total, space.free );
    }
    else
    {
        printf( "\nError %d reading drive!\n", ret );
    }
}