[fpc-devel] Determin file size - how?
Martin Schreiber
mse00000 at gmail.com
Thu Dec 15 08:46:58 CET 2011
On 12/15/2011 07:52 AM, Felipe Monteiro de Carvalho wrote:
> In lazarus/components/lazutils/fileutil.pas there is:
>
> function FileSize(const Filename: string): int64;
>
> And as a bonus it works only with UTF-8
>
MSEgui has lib/common/kernel/msefileutils.pas:
"
type
ext1fileinfoty = record
filetype: filetypety;
attributes: fileattributesty;
size: int64;
modtime: tdatetime;
accesstime: tdatetime;
ctime: tdatetime;
end;
ext2fileinfoty = record
id: int64;
owner: longword;
group: longword;
end;
fileinfoty = record
name: filenamety;
state: fileinfostatesty;
extinfo1: ext1fileinfoty;
extinfo2: ext2fileinfoty;
end;
function getfileinfo(const path: filenamety; var info: fileinfoty): boolean;
//false if not found
"
As a bonus it works with UnciodeString. ;-)
Martin
More information about the fpc-devel
mailing list