#include #include #include void main() { tell_user_sz("\n\nThis is a userland program.\n"); tell_user_sz("Opening sd0:TEST.TXT.\n"); struct file *f = open_file("sd0:TEST.TXT"); if (!f) { tell_user_sz("Failed to open.\n"); return; } tell_user_sz("Length: "); uint32_t size = file_size(f); tell_user_n(size); tell_user_sz(" bytes\n\nContents:\n"); char *buf = get_block(size + 1); read_from_file(f, size, buf); buf[size] = '\0'; close_file(f); tell_user_sz(buf); tell_user_sz("\n\nGoodbye!\n"); }