filesize

(FW >= 1.0)

filesize - returns the size of a file or stream

Description

int filesize(int handle)
Depending on the type of resource, this will work in different ways:
For files, this will return the number of bytes in the file.
For streams, this will return the number of unread bytes.
For sockets, this will return the number of unread bytes.
For serial ports, this will return the number of bytes in the receive buffer.

Parameters

handle

handle of a previously opened resource

Return Value

int number of bytes

Examples

<? 

$f = fopen("/index.cgi","r");
if ($f) {
print(filesize($f)); // will output the file size of the file
fclose($f);
} ?>