Unit 'amigados' Package
[Overview][Constants][Types][Procedures and functions][Index] [#amunits]

ExamineFH

Gets information on an open file

Declaration

Source position: amigados.pas line 1631

function ExamineFH(

  fh: LongInt;

  fib: pFileInfoBlock

):LongBool;

Arguments

fh

  

Filehandle you wish to examine

fib

  

FileInfoBlock, must be longword aligned.

Description

Examines a filehandle and returns information about the file in the FileInfoBlock. There are no guarantees as to whether the fib_Size field will reflect any changes made to the file size it was opened, though filesystems should attempt to provide up-to-date information for it.

Example

program ExamineFHTest;
uses
  AmigaDOS;
var
  FH: BPTR;
  FIB: PFileInfoBlock;
begin
  FH := DOSOpen('c:dir', MODE_OLDFILE);
  FIB := AllocDosObject(DOS_FIB, nil);
  if Assigned(FIB) and (FH <> 0) then
  begin
    if Boolean(ExamineFH(FH, FIB)) then
      writeln('Size: ',FIB^.fib_size);
  end;
  if Assigned(FIB) then FreeDosObject(DOS_FIB, FIB);
  if FH <> 0 then DOSClose(FH);
end.

Documentation generated on: 2021-07-30