Size: Integer;
Size: integer;
The Size property returns a file size (up to 2 Gb) in bytes.
To get size of any file, use the IFileInfo.SizeEx property.
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.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.ForeIO;
…
Public Shared Sub UserProc();
Var
FileInf: IFileInfo;
Begin
FileInf := New FileInfoClass.Create();
FileInf.Attach("C:\Application.txt");
If FileInf.Exists Then
System.Diagnostics.Debug.WriteLine(FileInf.Size);
End If;
End Sub UserProc;
See also: