GetFileSize

 

Description

Get the file size of a file from an input string containing a path and filename.

Syntax

string GetFileSize( string strPathAndFilename, uint * pnBytes = NULL, __int64* ullBytes = NULL)

Parameters

strPathAndFilename
[input] string containing a path and filename with filetype extension
pnBytes
[output] the size in bytes of the file. NULL by default.
pllBytes
[output] the size in bytes of the file. Support file size lager than 4G. NULL by default.

Return

Returns a Windows like file size formatted for display.

The result is accurate to 2 decimal places from Origin 9.3.

Examples

EX1

int GetFileSize_ex1()
{
    string    strFileSize;
    string    strDataFile = "C:\\Origin80\\Origin.ini";//specify the path and file name to a exiting file.
    strFileSize = GetFileSize(strDataFile);
    return 0;
}

Remark

See Also

header to Include

origin.h

Reference