mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-11-29 16:51:10 +00:00
45 lines
723 B
Plaintext
45 lines
723 B
Plaintext
|
/*********************************
|
||
|
* FILES - Test file.h02 Library *
|
||
|
*********************************/
|
||
|
|
||
|
#include <vic20.h02>
|
||
|
#include <stdio.h02>
|
||
|
#include <string.h02>
|
||
|
#include <file.h02>
|
||
|
|
||
|
char chan, c, i;
|
||
|
char dir = "$";
|
||
|
|
||
|
main:
|
||
|
//Initialize File System
|
||
|
fsinit();
|
||
|
|
||
|
//Open Directory
|
||
|
chan = fopen(8, &dir);
|
||
|
if (!chan) {
|
||
|
outstr("ERROR ");
|
||
|
prbyte(ferror());
|
||
|
outstr(" OPENING ");
|
||
|
putstr(&dir);
|
||
|
goto exit;
|
||
|
}
|
||
|
|
||
|
i = 0;
|
||
|
while() {
|
||
|
c = fgetc(chan);
|
||
|
if (feof(chan)) break;
|
||
|
i++;
|
||
|
if (i<4) continue;
|
||
|
if (c) {
|
||
|
putchr(c);
|
||
|
}
|
||
|
else {
|
||
|
newlin();
|
||
|
i=0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
goto exit;
|
||
|
|
||
|
|