summaryrefslogtreecommitdiff
path: root/src/user/dumptext/dumptext.c
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2020-09-13 17:12:29 -0400
committerBenji Dial <benji6283@gmail.com>2020-09-13 17:12:29 -0400
commit5481848e27fdd4fc859def9841a0283665531a46 (patch)
tree990a8df008214d85141a3bd10bd96898e64b0c37 /src/user/dumptext/dumptext.c
parent1e4a254674f668839e5de273916024c16814b045 (diff)
downloadportland-os-5481848e27fdd4fc859def9841a0283665531a46.tar.gz
fixed some paging bugs, added fault handlers and new programs
Diffstat (limited to 'src/user/dumptext/dumptext.c')
-rw-r--r--src/user/dumptext/dumptext.c15
1 files changed, 15 insertions, 0 deletions
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 <knob/file.h>
+#include <knob/user.h>
+
+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