3 first test for posix directory routines for the c64
5 - currently uses cbm_open, which conflicts with standard i/o,
6 which in turn makes it infact kindof unuseable. this can
7 be easily changed however, since the only reason not to use
8 open/read was that it currently appends ,u,r to filenames
9 - the offset in current dir stream should better be calculated
10 from the values returned by "read".
11 - the type flag isnt filled in atm.
12 - scandir/alphasort/versionsort is missing
13 - some bits are currently untested (ie, unused in the testprogram)
31 register struct dirent* E;
33 /* Explain usage and wait for a key */
34 printf ("Use the following keys:\n"
35 " g -> go ahead without stop\n"
36 " q -> quit directory listing\n"
37 " r -> return to last entry\n"
38 " s -> seek back to start\n"
39 "Press any key to start ...\n");
42 /* Open the directory */
45 printf("error opening %s: %s\n", name, strerror (errno));
49 /* Output the directory */
51 printf("contents of \"%s\":\n", name);
52 while ((E = readdir (D)) != 0) {
53 printf ("dirent.d_name[] : \"%s\"\n", E->d_name);
54 printf ("dirent.d_blocks : %10u\n", E->d_blocks);
55 printf ("dirent.d_type : %10d\n", E->d_type);
56 printf ("telldir() : %10lu\n", telldir (D));
68 seekdir (D, E->d_off);
83 printf("Done: %d (%s)\n", errno, strerror (errno));
86 /* Close the directory */