Tech Tip: Getting the size of a disk file
PRODUCT: 4D | VERSION: 2004.3 | PLATFORM: Mac & Win
Published On: January 10, 2006
Retrieving the size of a document can easily be performed using Get Document Size. This command returns the document size expressed in bytes. If a document is currently opened, you pass the document variable to the command; otherwise, you pass its pathname. Below is an example code that allows you to select a file and retrieve its size:
C_LONGINT($DocSize)
C_TIME($Winref)
$Winref:=Open document("")
CLOSE DOCUMENT($Winref)
$DocSize:=Get document size(Document)
ALERT(String($DocSize))