getFileSize()

The function checks the size of the defined file.

Synopsis

long getFileSize( string path);

Parameters

Parameter Meaning
path Path and name of the file, to be checked.

Return value

The function returns the file size in bytes if OK or in the event of an error, -1L.

Error

If the file does not exist.

Description

The function checks the size of the defined file. Copying large files can cause WinCC OA to reach the Emergency mode. To avoid this, check the file size before.

Example

main()


{


  long size;


  size = getFileSize("C:/Siemens/Automation/WinCC_OA/3.16/pictures/about.png");


  DebugN(size); // Dateigröße in Bytes


}

Under Windows the function getFileSize returns -1 if cyrillic characters or spaces are used in the file name/folder name.

Assignment

File functions

Availability

CTRL