Fill in a FileInfoBlock structure concerning a file or directory associated with a particular lock.
Source position: amigados.pas line 2304
function Examine64( |
Lock: LongInt; |
Fib: PFileInfoBlock; |
Tags: Pointer |
):LongInt; |
Lock |
|
lock to examine |
Fib |
|
file info to recieve the data |
Tags |
|
tags, no tags defined for now |
= 0 for error, otherwise success
Fill in a FileInfoBlock structure concerning a file or directory associated with a particular lock. FileInfoBlock.fib_Size64 contains the size of the file. FileInfoBlock.fib_NumBlocks64 contains the number of blocks for the file.
If scanning a filesystem tree recursively, you'll need to allocated a new PFileInfoBlock for each directory level.
To examine a directory, do the following:
|
Fill in a FileInfoBlock structure concerning a file or directory associated with a particular lock. |
|
|
Creates a dos object |
|
|
Examine an entire directory |
|
|
Return extra information from the system |
|
|
Fill in a FileInfoBlock structure concerning a file associated with a particular filehandle. |
program Examine64Test; uses AmigaDos; procedure CheckDir(ALock: BPTR); var FIB: PFileInfoBlock; begin FIB := AllocDosObject(DOS_FIB, nil); if Assigned(FIB) then begin if Examine64(ALock, FIB, nil) <> 0 then begin repeat writeln(FIB^.fib_FileName); until ExNext64(ALock, FIB, nil) = 0; end; if IOErr() = ERROR_NO_MORE_ENTRIES then writeln('nothing more found') else writeln('Something went wrong ', IOErr); FreeDosObject(DOS_FIB, FIB); end; end; var RamLock: BPTR; begin RamLock := Lock('RAM:', SHARED_LOCK); CheckDir(RamLock); Unlock(RamLock); end.