Subject | Re: [IBO] Database FileSize ? |
---|---|
Author | Dmitry Beloshistov |
Post date | 2006-06-03T11:07:59Z |
Hello, Frank!
You wrote to <IBObjects@yahoogroups.com> on Sat, 03 Jun 2006 07:12:44 -0000:
F> I want to show the actual database filesize in a statusbar,
F> the connection is made via an alias stored in firebirds alias.conf
F> The clients normaly don't know the exact db location on the server
F> nor do they know the location of the alias.conf
F> Does IBO have any functions to either return the full path to the
F> database, not only the alias or even it's filesize ?
F> Or is there another method you can recommend to get the fdb filesize
F> ?
Small example :
Function GetDatabaseSizePages(IB_Connection:TIB_Connection):integer;
begin
Result:=-1;
if Assigned(IB_Connection) then
Result:=IB_Connection.Characteristics.dbSizeInPages;
end;
Function GetDatabaseSize(IB_Connection:TIB_Connection):Int64;
var APages,APageSize:integer;
begin
Result:=-1;
if Assigned(IB_Connection) then
begin
APages:=GetDatabaseSizePages(IB_Connection);
APageSize:=IB_Connection.Characteristics.dbPage_Size;
Result:=Int64(APages)*Int64(APageSize);
end;
end;
WBR,Dmitry Beloshistov AKA [-=BDS=-]
You wrote to <IBObjects@yahoogroups.com> on Sat, 03 Jun 2006 07:12:44 -0000:
F> I want to show the actual database filesize in a statusbar,
F> the connection is made via an alias stored in firebirds alias.conf
F> The clients normaly don't know the exact db location on the server
F> nor do they know the location of the alias.conf
F> Does IBO have any functions to either return the full path to the
F> database, not only the alias or even it's filesize ?
F> Or is there another method you can recommend to get the fdb filesize
F> ?
Small example :
Function GetDatabaseSizePages(IB_Connection:TIB_Connection):integer;
begin
Result:=-1;
if Assigned(IB_Connection) then
Result:=IB_Connection.Characteristics.dbSizeInPages;
end;
Function GetDatabaseSize(IB_Connection:TIB_Connection):Int64;
var APages,APageSize:integer;
begin
Result:=-1;
if Assigned(IB_Connection) then
begin
APages:=GetDatabaseSizePages(IB_Connection);
APageSize:=IB_Connection.Characteristics.dbPage_Size;
Result:=Int64(APages)*Int64(APageSize);
end;
end;
WBR,Dmitry Beloshistov AKA [-=BDS=-]