IFileInfo.Size

Syntax

Size: Integer;

Description

The Size property returns a file size (up to 2 Gb) in bytes.

Comments

To get size of any file, use the IFileInfo.SizeEx property.

Example

Executing the example requires the C:\Application.txt file of less than 2 Gb size in the file system.

Add a link to the IO system assembly.

Sub UserProc;
Var
    FileInf: IFileInfo;
Begin
    FileInf := New FileInfo.Attach("C:\Application.txt");
    If FileInf.Exists Then
        Debug.WriteLine(FileInf.Size);
    End If;
    Dispose FileInf;
End Sub UserProc;

After executing the example the console window displays the size of the C:\Application.txt file.

See also:

IFileInfo