From 5481848e27fdd4fc859def9841a0283665531a46 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 13 Sep 2020 17:12:29 -0400 Subject: fixed some paging bugs, added fault handlers and new programs --- src/user/dumptext/dumptext.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/user/dumptext/dumptext.c (limited to 'src/user/dumptext') diff --git a/src/user/dumptext/dumptext.c b/src/user/dumptext/dumptext.c new file mode 100644 index 0000000..b10375c --- /dev/null +++ b/src/user/dumptext/dumptext.c @@ -0,0 +1,15 @@ +#include +#include + +void main(const char *path) { + struct file *f = open_file(path); + if (!f) { + tell_user_sz("Couldn't open file.\n"); + return; + } + char buf[] = { '\0', '\0' }; + while (read_from_file(f, 1, buf)) + tell_user_sz(buf); + tell_user_sz("\n"); + close_file(f); +} \ No newline at end of file -- cgit v1.2.3