File_SizeOpen()

… visits
Parent Previous Next

Syntax

File_SizeOpen(), Dword

Overview

Result Dword: The size of the currently open file in bytes.


Get the Size of the Currently Open File

File_SizeOpen() is used to get the size of the file that is currently open. This function provides the size of the file that has been opened for reading or writing, in bytes.

Example

File_SizeOpen()

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

While File_Open("dog.bmp") <> cErrOK : Wend                                                 'Open dog.bmp

dTemp = File_SizeOpen()                                                                     'Get dog.bmp size

File_Close()                                                                                'close file

dTemp = dTemp / 1024                                                                        'Convert to KB

TftPrintSndString("dog.bmp=" + Str$(Dec dTemp),1,0,2,1,GREEN,BLACK,0)                       'Display file size

While File_Open("Bird.jpg") <> cErrOK : Wend                                                'Open Bird.jpg

dTemp = File_SizeOpen()                                                                     'Get Bird.jpg size

File_Close()                                                                                'close file

dTemp = dTemp / 1024                                                                        'Convert to KB

TftPrintSndString("Bird.jpg=" + Str$(Dec dTemp),1,0,3,1,GREEN,BLACK,0)                      'Display file size

While File_Open("Cat.jpg") <> cErrOK : Wend                                                 'Open Cat.jpg

dTemp = File_SizeOpen()                                                                     'Get Cat.jpg size

File_Close()                                                                                'close file

dTemp = dTemp / 1024                                                                        'Convert to KB

TftPrintSndString("Cat.jpg=" + Str$(Dec dTemp),1,0,4,1,GREEN,BLACK,0)                       'Display file size

File_SizeOpen()File_SizeOpen()

Created with the Personal Edition of HelpNDoc: Achieve Professional Documentation Results with a Help Authoring Tool