Returns the size of a specified file.
Kernel.bdh
FSizeGet( in hFile : number, out nSize : number): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
hFile | Valid handle to an open file. This handle must have been returned from a previous call to FOpen. |
nSize | Variable receiving the file size |
dcltrans transaction TMain var hFile, nSize : number; sOutput : string; begin // create a file and store a string FOpen(hFile, "c:\\temp\\dummyfile.txt", OPT_FILE_ACCESS_READWRITE, OPT_FILE_CREATE); sOutput := "Hello world!"; FWrite(hFile, sOutput); write("new file created"); writeln; // display current file size FSizeGet(hFile, nSize); write("file size = "); write(nSize); writeln; // close file FClose(hFile); write("file closed"); writeln; end TMain;
new file created file size = 12 file closed
WebFileUpload01.bdf