Concept Framework 2.0 documentation Contents | Index

standard.C.io.fsize

Name Version Deprecated
fsize version 1.0 no

Prototype:
number fsize(number fd)

Parameters:
fd      [in] A valid file descriptor

Description:
Gets the file length, in bytes, of the target file.

Example:
import standard.C.io

define FILENAME          "test.txt"

class Main {
     function Main() {
          if(!(var fd = fopen( FILENAME, "r" )))
               echo "The file " + FILENAME + " was not opened\n";
          else {               
               var buffer = "";
               fread(buffer, 1, fsize(fd), fd);
               echo buffer;
               fclose(fd);
          }
     }
}  

Results 
Content of the file  

Returns:
Returns the file length, in bytes, of the target file

Documented by Simona Plesuvu, generation time: Fri Jan 21 18:06:19 2011 GMT(c)2011 RadGs Software