--- /dev/null
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+void cat(char *name)
+{
+ FILE *fd = fopen(name, "r");
+ if (!fd) {
+ printf("Error opening '%s': %s\n",
+ name, strerror(errno));
+ return;
+ }
+
+ int len = 0;
+ char buf[32] = {};
+ while (!feof(fd)) {
+ len = fread(buf, 1, sizeof(buf), fd);
+ printf("{{ Read %d bytes }}", len);
+ fwrite(buf, 1, len, stdout);
+ }
+
+}
+
+int main()
+{
+ cat("io.c");
+ cat("junk.c");
+ return 0;
+}