summaryrefslogtreecommitdiff
path: root/src/user/include/knob/file.h
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2021-03-01 22:35:26 -0500
committerBenji Dial <benji6283@gmail.com>2021-03-01 22:35:26 -0500
commit1d69a46f5d9823bbf2e6211ca367b409d2d5f7a7 (patch)
treea49a5498080551270a827a205cde49477d4d89ff /src/user/include/knob/file.h
parent6f1b50a4cc6c232ee505a543f006abb1c6cd33cf (diff)
downloadportland-os-1d69a46f5d9823bbf2e6211ca367b409d2d5f7a7.tar.gz
minimal file writing, shutdown keybinding (Win+Shift+Q)
Diffstat (limited to 'src/user/include/knob/file.h')
-rw-r--r--src/user/include/knob/file.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/user/include/knob/file.h b/src/user/include/knob/file.h
index 8862098..d283288 100644
--- a/src/user/include/knob/file.h
+++ b/src/user/include/knob/file.h
@@ -12,12 +12,14 @@ struct file *open_file(const char *path);
void close_file(struct file *f);
uint32_t read_from_file(struct file *f, uint32_t max, void *buf);
+uint32_t write_to_file(struct file *f, uint32_t max, void *buf);
//return value and max_length don't include null terminator
uint32_t read_line_from_file(struct file *f, char *sz, uint32_t max_length);
uint32_t seek_file_to(struct file *f, uint32_t to);
int32_t seek_file_by(struct file *f, int32_t by);
uint32_t file_size(struct file *f) __attribute__ ((pure));
+void trunc_file(struct file *f);
//return value must be manually freed, unless it is a null pointer
_dir_info_entry_t *get_directory_info(const char *path, uint32_t *count_out);