Home > Language Reference > File Functions > FileSize

FileSize

The FileSize function returns the size of the specified file.

Usage

Used for example to test if a file update is successful.

Syntax

var=FileSize(<filename>)

Parameters

<filename>, string, name of the file. 

Return value

var, integer. It contains the size of the file (number of bytes). If <filename> is empty or the file does not exist, no error message is returned and the return value is -1. 

See also

FileDate$
FileTime$
FileVersion$
FileAttr$

Example

a=FileSize("c:\wttest\myfile.txt")
msgbox(a)