File_DiskFull()

… visits
Parent Previous Next

Syntax

File_DiskFull(), Bit

Return value

Value

Meaning

0

The disk is not full – there is still available space on the SD card.

1

The disk is full – no more data can be written to the card.

Overview

Check if the Disk is Full

File_DiskFull() is a variable, not a procedure, that you can check at any time to determine if the SD card (or the storage medium) is full.

This can help you monitor the available space while performing file operations.

Example

File_DiskFull()

Notes

TftSetUp(0, 0)                                                                                 'Set screen

TftResetScreen(BLACK)                                                                       'Reset screen

TftSetSndFont(0,0)                                                                          'Set Font0

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

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

File_TimeModified(5,11,24, 12,39,45)                                                        'Set modified property

While File_Append("append.log") <> cErrOK : Wend                                            'Open file append.log to edit data

TftPrintSndString("Append append.log OK",1,0,2,1,GREEN,BLACK,0)                             'Confirm append.log is open

Repeat

File_WriteByte("A")                                                                     'write data to append.Log

Until File_DiskFull() = 1                                                                   'If SD card is full, break

File_Close()                                                                                'Close file

TftPrintSndString("Close append.log OK",1,0,3,1,GREEN,BLACK,0)                              'Confirm append.log is closed

TftPrintSndString("Card full",1,0,4,1,GREEN,BLACK,0)                                        'Confirm card full

File_DiskFull()File_DiskFull()File_DiskFull()

Created with the Personal Edition of HelpNDoc: Easily create Help documents