WKern
Loading...
Searching...
No Matches
printconts.c File Reference
#include <fileio/fileio.h>
#include <io/kio.h>
#include <mem/kmem.h>
#include <types/nums.h>
#include <utils/util.h>

Go to the source code of this file.

Functions

void Fileconts (const char *filename, const char *ext)
 Display the contents of a file in the FAT16 filesystem.

Function Documentation

◆ Fileconts()

void Fileconts ( const char * filename,
const char * ext )

Display the contents of a file in the FAT16 filesystem.

Prints contents of a FAT16 file.

This function searches the FAT16 root directory for a file matching the specified filename and extension. If found, it reads the first data cluster of the file and prints its contents as ASCII characters to the console. Non-printable characters are displayed as dots ('.'). The reading stops either at the end of the cluster or when a FAT16 EOF marker (0x1A) is found.

Parameters
filenameThe 8-character filename (without extension).
extThe 3-character file extension.
Note
The function assumes the FAT16 filesystem structure is accessible through the global fat16 variable.

Definition at line 40 of file printconts.c.