|26h||FL$CATL||list data files|
|Input||A = 1 for 1st call, 0 subsequently
B = device (0 to 3)
X = addresse to put filename (leading byte count)
|Output||- none -|
When called repeatedly, returns each the name of each file on a device as a leading byte count string at the address given in X in the form <pack>:<name> .
A is set to 1 before the first call to FL$CATL and 0 on subsequent calls. When there are no more files in the directory the carry is set and B = 238 (end of file error). B contains the device number (0 for A:, 1 for B: etc.). Used in the OPL function DIR$.
Calling FL$CATL is equivalent to calling FL$BCAT with UTW_S0+1 = $81.
LDAA #1 ; A=1 first time FL$CATL called BRA FIRST ; For each file in directory: LOOP: LDX #TEMP ; print leading string in temp PSHX ; pass address to UT$DISP OS UT$DISP DB "%s" ; leading byte count string DB 13,10 ; CR LF DB 0 ; terminator for format string CLRA ; A=0 on subsequent calls to FL$CATL FIRST: LDX #TEMP ; filenames be placed in TEMP by FL$CATL LDAB #MY_DEVICE ; which device : 0 - 3 for A: to D: OS FL$CATL BCC LOOP ; repeat until error returned CMPB #238 ; end-of-file error means normal completion BEQ DONE ERROR: ... ; otherwise report error DONE: ...
|Errors||238 - file not found (normal completion)
194 - battery too low
200 - read pack err
240 - unknown pack
241 - pack not blank
243 - bad device name
245 - write pack err
246 - no pack