Fatlib is (expected to be) a C library manipulating DOS floppy images containing FAT filesystem. It compiles currently under Linux, and possibly BSD.
Not well tested, esp. FAT32.
Most functions return -1 or NULL on error and set errno.
Disk image is represented by opaque DRIVE* type returned by an open function and supplied as argument to other functions.
Fat_dops structure contains user's methods (read, write...) providing image abstraction. They operate on series of bytes not organized in sectors, it is expected that a user will reorganize and buffer disk accesses.
Forward slash (
/) is a separator in paths (Unix convention).
File names use UTF-8.
For file i/o generic FILE* interface is used [stdio.h]. It can be obtained by:
If something has been written to a FILE, it should be explicitly fclosed on exit to ensure that stdio buffers are flushed.
Directory operations use FDIR* pointer (similar to libc's DIR*):
See fatlib.h for more...