Function will return quad size of file or -1 if any error.
Code:
FUNCTION FileSize(BYVAL sFileName AS STRING) AS QUAD 'Bytes = FileSize(sFileName) returns file size or -1 if any error LOCAL FindData AS WIN32_FIND_DATA LOCAL hDir AS LONG hDir = FindFirstFile(BYVAL STRPTR(sFileName), FindData) IF hDir = -1 THEN 'if not found return -1 FUNCTION = -1 ELSE 'return number of bytes FindClose hDir 'Thank you, Pierre Bellisle FUNCTION = MAK(QUAD, FindData.nFileSizeLow , FindData.nFileSizeHigh) END IF END FUNCTION