Size

Size returns the size of a file.

Syntax

Size ([highpart])

Returns

Size of the file (the low part property of the size of the file).

More Information

A file size has two parts. A high part and a low part. What is returned by the function is the low part. The high part is an optional parameter in which you can Get the highpart size property of a file should you need it.

Example

Displays the size of the hosts file:

Function Main

Dim textfile As Object

Dim size As Integer

Set textfile = File.Connect("127.0.0.1")

If textfile.Open("c:\windows\system32\drivers\etc\hosts", GENERIC_READ, Open_Existing) Then

size = Textfile.Size

echo("your host file has a file size of : " & size & “ bytes”)

textfile.Close

End If

End Function