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)

    
    // 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

Share :

Related Posts

LogDeinit

LogDeinit Description Shut down logging subsystem and release resources

Read More

LOG_SYS_INFO

LOG_SYS_INFO Description Writes an informational log message along with errno explanation appended at then end of final string.

Read More

Vec

Vec Description Vector type for directory contents.

Read More