file size
Returns the size of the files matching the path name. __Wildcards_ are allowed, where sum the size of all files found inside the specified directory are summed. Subdirectories will not be touched. Directory entries do not attribute to the total size, even if some operating systems report a non-zero size for subdirectories.
Indirect parameter passing is disabled
1
No. | Type | Description |
---|---|---|
Opt. 1 input |
string | path and file name Specify file name (in working directory) or combination of path and file name. |
Type | Description |
---|---|
numeral | Total size Size of all files identified, summed, unit is bytes. -1 if not found |
Specified file name is a directory
// Function 'string' adds thousand separators to make numbers readable
echo( str( file size( system info[bin directory] + "\b4p.exe" ), "#,000", local ) ); // Finds a file in Windows
echo( str( file size( system info[bin directory] + "/b4p" ), "#,000", local ) ); // Finds a file in Linux/MacOS
echo( file size( "Non-existing File.txt" ) ); // -1
1'707'520
-001
-1