Examine the next entry in a directory.
Source position: amigados.pas line 2306
function ExNext64( |
Lock: LongInt; |
Fib: PFileInfoBlock; |
Tags: Pointer |
):LongInt; |
Lock |
|
lock on the direcory the contents of which to examine |
Fib |
|
A FileInfoBlock previously initialized by Examine64() (or used before with ExNext64()), fib_Size64 contains the size of the file. fib_NumBlocks64 contains the number of blocks for the file. |
Tags |
|
tags, no tags defined for now, supply nil |
= 0 for fail, <> 0 for success whether the operation was successful or not. A failure occurs also if there is no "next" entry in the directory. Then IoErr() equals ERROR_NO_MORE_ENTRIES.
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 |
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.