On Windows, the filesize is not updated in disk until the file handle is closed.
While DBI files are a typical use case of this requirement, the following code example and can be customised to requirement to determine any file's size. For example, the code sample attached to this case extends to all client-temp files.
USING System*.*.
USING System.IO*.*.
DEFINE VARIABLE cFileName AS CHARACTER.
DEFINE VARIABLE i64FileSize AS INT64.
DEFINE VARIABLE myinfo AS System.IO.FileInfo.
cFileName = "c:\temp\DBI63824a63856".
myinfo = new System.IO.FileInfo(cFileName).
i64FileSize = myinfo:LENGTH.
MESSAGE i64FileSize
VIEW-AS ALERT-BOX INFO BUTTONS OK.
Another code example is provided in Article
4GL procedure to monitor temporary files growth