home *** CD-ROM | disk | FTP | other *** search
- *****************************************************************
- FUNCTION FILESIZE (file_name)
- *****************************************************************
-
- * Returns size of a file in bytes
-
- * Copyright(c) 1991 -- James Occhiogrosso
-
- # include "fileio.ch"
- # translate F_LEN(<n>) => FSEEK(<n>, FS_SET, FS_END)
-
- LOCAL handle := file_size := 0
-
- * Open the file and get a handle
- handle = FOPEN(file_name, 0)
-
- * Get file size or -1 on error
- file_size = IF(handle != -1, F_LEN(handle), -1)
-
- * Close file and return
- FCLOSE(handle)
-
- RETURN file_size
-
-