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

Go to the source code of this file.

Functions

void Mkfile (const char *filename, const char *ext)
 Create a new empty file entry in the FAT16 root directory.

Function Documentation

◆ Mkfile()

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

Create a new empty file entry in the FAT16 root directory.

Creates a new empty file in the FAT16 root directory.

This function searches for a free root directory entry and a free cluster, then creates a new directory entry for the specified filename and extension. It initializes the directory entry with default attributes and zero file size.

Parameters
filenameThe 8-character filename (without extension).
extThe 3-character file extension.
Note
The function assumes FAT16 filesystem data is accessible through the global fat16 structure.
Warning
If no free directory entry or cluster is available, the function prints an error message and returns without creating the file.

Definition at line 41 of file mkfile.c.