The FileSize function checks the size of a file in bytes.
FACTS:
* none
Mini Tutorial:
This example, check if a file exists
; Get the current dir$ and place it in the PATH variable Path$=CurrentDir$() ; Read the first filename from this path File$=FirstFile$(path$) ; While File$ is not equal to a NULL string, run the while loop While File$<>"" ; Add the current path$ and Filepath$=path$+"\"+file$ ; Check if this is a filename or folder name If FileType(FilePath$)=2 ; if it's a folder, then display it's name Print "Folder:"+File$ Else ; if it's a FILEname, then display it's name ; and filesize in bytes Size=FileSize(Filepath$) Print " File:"+File$+" "+Str$(size) EndIf ; Grab the NEXT filename from this path File$=NextFile$() ; Jump back to the while while statement EndWhile ; Display the Screen and wait for a key press Sync WaitKey |
This example would output might out something like this. Folder: HelloWorld File:MyFile.txt 3445 |
|