File_FreeSpaceKB()

Parent Previous Next

File_FreeSpaceKB(), Dword


Result Dword = The result is a Dword (32-bit unsigned integer) representing the free space on the SD card in kilobytes (KB).


Get SD Card Free Space in KB


The File_FreeSpaceKB() command retrieves the remaining free space on the SD/MMC card in kilobytes (KB). This is useful for checking how much storage is available on the card before writing or adding more files.


Example:

File_FreeSpaceKB()


Note: The free space is calculated by scanning the card's sectors, so it may take a moment to return the value (depending on the size of the card and the amount of used space).


    TftSetUp(0)                                                                                 'Set screen

    TftResetScreen(BLACK)                                                                       'Reset screen

    TftSetSndFont(0,0)                                                                          'Set Font0

    While File_Init() <> cErrOK : Wend                                                          'Initialize SD Card

    TftPrintSndString("Sd Init OK",1,0,0,1,GREEN,BLACK,0)                                       'Confirm Initialize SD Card

    TftPrintSndString("Disk size = " + Str$(Dec File_DiskSizeKB()),1,0,1,1,GREEN,BLACK,0)       'Display SD Card size   

    TftPrintSndString("Disk space = " + Str$(Dec File_FreeSpaceKB()),1,0,2,1,GREEN,BLACK,0)     'Display SD Card free space   







Created with the Personal Edition of HelpNDoc: Transform Your Documentation Process with HelpNDoc's Project Analyzer