In v21 GET_FILESYSTEM returns the number of files or megabyte even if this number is higher than MAX_FILE_COUNT
This occurs for the functions:
In v24 these functions returns zero:
U00020408 0000000000000000
This is a functionality that never worked and that has been properly implemented in the Windows Java Agent.
As in many UC4 script functions: if the return is 0 - the last-error must be checked.
Using the following script that catches the error number and message, will help to determine why the GET_FILESYSTEM function returns zero if the number of files exceeds MAX_FILE_COUNT.
The following UC4 script example shows this error routine for PATH_FILE_COUNT but it works in the same way for the FILESYSTEM_SPACE_[TOTAL | USED | FREE] sub functions :
:SET &NumberFiles# = GET_FILESYSTEM(<AGENT>, "<FOLDER>", PATH_FILE_COUNT)
:SET &ERRNR# = SYS_LAST_ERR_NR()
:IF &ERRNR# NE "0"
: SET &ERRINS# = SYS_LAST_ERR_INS()
: SET &MESSAGE# = GET_MSG_TXT (&ERRNR#,&ERRINS#)
: P &MESSAGE#
: ELSE
: P "Number of files ",&NumberFiles#
:ENDIF
Error:
2025-12-15 10:39:36 - U00020408 U02000121 File limit ('5') for file event ('4851007') has been exceeded.Set MAX_FILE_COUNT=0 (unlimited) in the UC_HOSTCHAR_<AGENT> to keep the v21 behavior. This may have a performance impact.