Retro Rocket OS
BASIC-Powered Operating System
Loading...
Searching...
No Matches
FILESIZE Function
FILESIZE(string-expression)

Returns the size of a file in bytes. The parameter is a path to a file (absolute or relative to CSD$).


Examples

PRINT FILESIZE("/system/webserver/index.html")
REM Guard against missing files
path$ = "data.bin"
IF FILETYPE$(path$) = "file" THEN
PRINT "Size = "; FILESIZE(path$); " bytes"
ELSE
PRINT "Not a regular file"
ENDIF

Notes

  • Raises an error if the path does not exist or refers to a directory.
  • Result is a 64-bit integer (bytes).

See also: FILETYPE$ · OPENIN · READ$ · BINREAD