File_SizeOpen(), Dword
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:
• This command will only work if a file is currently open using File_Open(), File_Append(), or File_OpenAt().
• To check the size of a different file, you must first close the currently open file using File_Close(), and then you can call File_Size() to check the size of another file.
TftSetUp(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 |
|
Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with a Help Authoring Tool