ciabatta/test/test_io.c

18 lines
293 B
C
Raw Normal View History

2022-06-24 02:43:47 +00:00
#include <stdio.h>
2022-07-24 09:31:35 +00:00
int main(void)
{
2022-07-24 09:31:35 +00:00
char const *filename = "todo";
FILE *f = fopen(filename, "rb");
if(f == NULL) {
printf("File %s doesn't exist\n", filename);
return 1;
}
int c;
while((c=fgetc(f)) != EOF) {
putchar(c);
}
2022-06-24 02:43:47 +00:00
return 0;
}