SysGetFileSize

Table of Contents

SysGetFileSize

Description

Get size of file without opening it.

Parameters

NameDirectionDescription
filenameinName/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)

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

Share :

Related Posts

SysGetDirContents

SysGetDirContents Description Read directory contents into a vector. Current contents of the vector will be cleared out.

Read More