JCL Help:GetSizeOfFile@THandle

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Returns the size of a file.


Pascal

 function GetSizeOfFile(const FileName: string): Int64; overload;
function GetSizeOfFile(const FileInfo: TSearchRec): Int64; overload;
function GetSizeOfFile(Handle: THandle): Int64; overload;


Parameters

Parameters Description
const FileName: string Fully qualified name of the file for which to determine the size.
Handle: THandle Handle of the file for which to determine the size. This handle must have been opened with sufficient rights (GENERIC_READ at the very least). The function assumes the handle is valid and silently fails if it is not.


Return Value

The size of the file, in bytes. If the function fails to determine the size of the file it raises an exception.


Description

The GetSizeOfFile returns the size, in bytes of the specified file. Note that the returned value is the actual size of the file. This may, and most likely will, differ from the storage the file actually occupies on the disk.


About

Unit

JclFileUtils


Donator

David Hervieux (Win32)


Contributors

Robert Rossmair (Unix)


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page