2 Copyright © 1995-2002, The AROS Development Team. All rights reserved.
9 #include <proto/exec.h>
12 #include <dos/exall.h>
13 #include <dos/rdargs.h>
15 #include <exec/memory.h>
16 #include <exec/types.h>
18 #include <utility/tagitem.h>
21 #include <aros/debug.h>
23 #define ARG_TEMPLATE "DIRECTORY"
26 static const char version
[] = "$VER: ExNext 41.1 (30.01.2000)\n";
28 int main(int argc
, char *argv
[])
31 IPTR
* args
[TOTAL_ARGS
] = { NULL
};
35 Return_Value
= RETURN_OK
;
37 rda
= ReadArgs(ARG_TEMPLATE
, (LONG
*)args
, NULL
);
41 lock
= Lock("", ACCESS_READ
);
43 lock
= Lock((STRPTR
)args
[0], ACCESS_READ
);
47 struct FileInfoBlock
* FIB
;
49 FIB
= AllocVec(sizeof(struct FileInfoBlock
), MEMF_CLEAR
);
52 success
= Examine(lock
, FIB
);
53 kprintf("calling ExNext()...\n");
54 success
= ExNext(lock
, FIB
);
55 kprintf("called ExNext()\n");
56 while (success
!= DOSFALSE
)
59 if (FIB
->fib_DirEntryType
< 0)
60 printf("%s\n",FIB
->fib_FileName
);
62 printf("%s (not a file)\n", FIB
->fib_FileName
);
63 kprintf("calling ExNext()...\n");
64 success
= ExNext(lock
, FIB
);
65 kprintf("called ExNext()\n");
73 PrintFault(IoErr(), "ExNext");
74 Return_Value
= RETURN_FAIL
;
79 PrintFault(IoErr(), "ExNext");
80 Return_Value
= RETURN_ERROR
;
86 return (Return_Value
);