Skip to content
SysGetFileSize

SysGetFileSize

SysGetFileSize

Description

Get size of file without opening it.

Parameters

Name Direction Description
filename in Name/path of file.

Success

Non-negative value representing size of file in bytes.

Failure

Returns -1 if file cannot be accessed.

Usage example (Cross-references)

Usage examples (Cross-references)
    
        // get actual size of file
        i64 fsize = SysGetFileSize(filename);
        if (-1 == fsize) {
            LOG_ERROR("failed to get file size");
    
    // Cross-platform function to get file size
    i64 SysGetFileSize(const char *filename) {
    #ifdef _WIN32
        // Windows-specific code using GetFileSizeEx
Last updated on