26 lines
544 B
C
26 lines
544 B
C
#include "os.h"
|
|
#include "stdlib.h"
|
|
#include "stdio.h"
|
|
#include "string.h"
|
|
#include "assert.h"
|
|
|
|
int main(int argc, char **argv) {
|
|
for (int i = 1; i < argc; i++) {
|
|
int fd = os_fopen(argv[i], "r");
|
|
if (fd < 1) {
|
|
printf("Couldn't open file: %s (%i)\n", argv[i], fd);
|
|
continue;
|
|
}
|
|
|
|
int read;
|
|
char buf[2];
|
|
while (read = os_fread(buf, 1, 1, fd), read == 1) {
|
|
buf[read] = '\0';
|
|
printf("%s", buf);
|
|
}
|
|
printf("\n");
|
|
}
|
|
|
|
return 0;
|
|
}
|