libfsfat(3)

πŸ“¦
version 0~20260208 Β· 2 versions
, in ubuntu stonking

πŸ’– libfsfat(3) β€” the FAT filesystem library, but make it a group chat πŸ’–

okay so bestie, this is a Library Functions Manual page for libfsfat ✨ it lives in the header libfsfat.h, which is also the include file the SYNOPSIS keeps yelling about. This is C library energy, it's giving "I read FAT volumes for breakfast" and honestly? slay. πŸ‘‘

If you're the kind of person who thinks a file allocation table is a seating chart for files, you're in the right place. Let's go. πŸ¦‹


🌸 NAME 🌸

libfsfat.h β€” Library to support the File Allocation Table (FAT) file system format


✨ SYNOPSIS ✨

#include <libfsfat.h>

πŸ’… Support functions

const char *
libfsfat_get_version(void);

int
libfsfat_get_access_flags_read(void);

int
libfsfat_get_codepage(int *codepage, libfsfat_error_t **error);

int
libfsfat_set_codepage(int codepage, libfsfat_error_t **error);

int
libfsfat_check_volume_signature(const char *filename,
    libfsfat_error_t **error);
Available when compiled with wide character string support: πŸ‘€
int
libfsfat_check_volume_signature_wide(const wchar_t *filename,
    libfsfat_error_t **error);
Available when compiled with libbfio support: 🫢
int
libfsfat_check_volume_signature_file_io_handle(libbfio_handle_t *file_io_handle,
    libfsfat_error_t **error);

πŸ—£οΈ Notify functions

the ones that control how loudly the library talks to you. verbose mode is literally main character energy for debug output.

void
libfsfat_notify_set_verbose(int verbose);

int
libfsfat_notify_set_stream(FILE *stream, libfsfat_error_t **error);

int
libfsfat_notify_stream_open(const char *filename,
    libfsfat_error_t **error);

int
libfsfat_notify_stream_close(libfsfat_error_t **error);

😭 Error functions

when things go wrong (and bestie, sometimes they do), these are the cleanup crew. freeing, printing, sprinting, and backtracing, no cap.

void
libfsfat_error_free(libfsfat_error_t **error);

int
libfsfat_error_fprint(libfsfat_error_t *error, FILE *stream);

int
libfsfat_error_sprint(libfsfat_error_t *error, char *string,
    size_t size);

int
libfsfat_error_backtrace_fprint(libfsfat_error_t *error, FILE *stream);

int
libfsfat_error_backtrace_sprint(libfsfat_error_t *error, char *string,
    size_t size);

πŸ’Ώ Volume functions

the big ones. initialize, free, abort, open, close β€” the open/close arc is giving classic.

int
libfsfat_volume_initialize(libfsfat_volume_t **volume,
    libfsfat_error_t **error);

int
libfsfat_volume_free(libfsfat_volume_t **volume,
    libfsfat_error_t **error);

int
libfsfat_volume_signal_abort(libfsfat_volume_t *volume,
    libfsfat_error_t **error);

int
libfsfat_volume_open(libfsfat_volume_t *volume, const char *filename,
    int access_flags, libfsfat_error_t **error);

int
libfsfat_volume_close(libfsfat_volume_t *volume,
    libfsfat_error_t **error);

and then the getting-to-know-you era: format, label sizes and labels in utf8 and utf16, root directory, and file entries by identifier and by path 🌈

int
libfsfat_volume_get_file_system_format(libfsfat_volume_t *volume,
    uint8_t *file_system_format, libfsfat_error_t **error);

int
libfsfat_volume_get_utf8_label_size(libfsfat_volume_t *volume,
    size_t *utf8_string_size, libfsfat_error_t **error);

int
libfsfat_volume_get_utf8_label(libfsfat_volume_t *volume,
    uint8_t *utf8_string, size_t utf8_string_size,
    libfsfat_error_t **error);

int
libfsfat_volume_get_utf16_label_size(libfsfat_volume_t *volume,
    size_t *utf16_string_size, libfsfat_error_t **error);

int
libfsfat_volume_get_utf16_label(libfsfat_volume_t *volume,
    uint16_t *utf16_string, size_t utf16_string_size,
    libfsfat_error_t **error);

int
libfsfat_volume_get_root_directory(libfsfat_volume_t *volume,
    libfsfat_file_entry_t **file_entry, libfsfat_error_t **error);

int
libfsfat_volume_get_file_entry_by_identifier(libfsfat_volume_t *volume,
    uint64_t identifier, libfsfat_file_entry_t **file_entry,
    libfsfat_error_t **error);

int
libfsfat_volume_get_file_entry_by_utf8_path(libfsfat_volume_t *volume,
    const uint8_t *utf8_string, size_t utf8_string_length,
    libfsfat_file_entry_t **file_entry, libfsfat_error_t **error);

int
libfsfat_volume_get_file_entry_by_utf16_path(libfsfat_volume_t *volume,
    const uint16_t *utf16_string, size_t utf16_string_length,
    libfsfat_file_entry_t **file_entry, libfsfat_error_t **error);
Available when compiled with wide character string support: πŸ‘‘
int
libfsfat_volume_open_wide(libfsfat_volume_t *volume,
    const wchar_t *filename, int access_flags,
    libfsfat_error_t **error);
Available when compiled with libbfio support: 🧚
int
libfsfat_volume_open_file_io_handle(libfsfat_volume_t *volume,
    libbfio_handle_t *file_io_handle, int access_flags,
    libfsfat_error_t **error);

πŸ—‚οΈ File entry functions

everything a file or directory entry could ever want to tell you about itself. timestamps, attribute flags, names in utf8 and utf16, sub entries, reading, seeking, offsets, sizes and extents. it's giving ✨ thorough ✨

int
libfsfat_file_entry_free(libfsfat_file_entry_t **file_entry,
    libfsfat_error_t **error);

int
libfsfat_file_entry_get_identifier(libfsfat_file_entry_t *file_entry,
    uint64_t *identifier, libfsfat_error_t **error);

int
libfsfat_file_entry_get_access_time(libfsfat_file_entry_t *file_entry,
    uint64_t *fat_timestamp, libfsfat_error_t **error);

int
libfsfat_file_entry_get_creation_time(libfsfat_file_entry_t *file_entry,
    uint64_t *fat_timestamp, libfsfat_error_t **error);

int
libfsfat_file_entry_get_modification_time(libfsfat_file_entry_t *file_entry,
    uint64_t *fat_timestamp, libfsfat_error_t **error);

int
libfsfat_file_entry_get_file_attribute_flags(libfsfat_file_entry_t *file_entry,
    uint16_t *file_attribute_flags, libfsfat_error_t **error);

name era πŸ’•

int
libfsfat_file_entry_get_utf8_name_size(libfsfat_file_entry_t *file_entry,
    size_t *utf8_string_size, libfsfat_error_t **error);

int
libfsfat_file_entry_get_utf8_name(libfsfat_file_entry_t *file_entry,
    uint8_t *utf8_string, size_t utf8_string_size,
    libfsfat_error_t **error);

int
libfsfat_file_entry_get_utf16_name_size(libfsfat_file_entry_t *file_entry,
    size_t *utf16_string_size, libfsfat_error_t **error);

int
libfsfat_file_entry_get_utf16_name(libfsfat_file_entry_t *file_entry,
    uint16_t *utf16_string, size_t utf16_string_size,
    libfsfat_error_t **error);

walking down into sub entries 🌳

int
libfsfat_file_entry_get_number_of_sub_file_entries(libfsfat_file_entry_t *file_entry,
    int *number_of_sub_entries, libfsfat_error_t **error);

int
libfsfat_file_entry_get_sub_file_entry_by_index(libfsfat_file_entry_t *file_entry,
    int sub_file_entry_index, libfsfat_file_entry_t **sub_file_entry,
    libfsfat_error_t **error);

int
libfsfat_file_entry_get_sub_file_entry_by_utf8_name(libfsfat_file_entry_t *file_entry,
    const uint8_t *utf8_string, size_t utf8_string_length,
    libfsfat_file_entry_t **sub_file_entry, libfsfat_error_t **error);

int
libfsfat_file_entry_get_sub_file_entry_by_utf16_name(libfsfat_file_entry_t *file_entry,
    const uint16_t *utf16_string, size_t utf16_string_length,
    libfsfat_file_entry_t **sub_file_entry, libfsfat_error_t **error);

reading, seeking, and the whole extents thing πŸ“–

ssize_t
libfsfat_file_entry_read_buffer(libfsfat_file_entry_t *file_entry,
    void *buffer, size_t buffer_size, libfsfat_error_t **error);

ssize_t
libfsfat_file_entry_read_buffer_at_offset(libfsfat_file_entry_t *file_entry,
    void *buffer, size_t buffer_size, off64_t offset,
    libfsfat_error_t **error);

off64_t
libfsfat_file_entry_seek_offset(libfsfat_file_entry_t *file_entry,
    off64_t offset, int whence, libfsfat_error_t **error);

int
libfsfat_file_entry_get_offset(libfsfat_file_entry_t *file_entry,
    off64_t *offset, libfsfat_error_t **error);

int
libfsfat_file_entry_get_size(libfsfat_file_entry_t *file_entry,
    size64_t *size, libfsfat_error_t **error);

int
libfsfat_file_entry_get_number_of_extents(libfsfat_file_entry_t *file_entry,
    int *number_of_extents, libfsfat_error_t **error);

int
libfsfat_file_entry_get_extent_by_index(libfsfat_file_entry_t *file_entry,
    int extent_index, off64_t *extent_offset, size64_t *extent_size,
    uint32_t *extent_flags, libfsfat_error_t **error);

πŸ’œ DESCRIPTION πŸ’œ

The libfsfat_get_version() function is used to retrieve the library version. that's it, that's the vibe check. πŸ’…


πŸ”₯ RETURN VALUES πŸ”₯

Most of the functions return NULL or -1 on error, dependent on the return type. For the actual return values see "libfsfat.h".

so like, don't guess bestie, go read the header. 😌


🌈 ENVIRONMENT 🌈

None


πŸŽ€ FILES πŸŽ€

None


⭐ NOTES ⭐

libfsfat can be compiled with wide character support (wchar_t). yes queen wide char representation. πŸ’–

To compile libfsfat with wide character support use:

./configure --enable-wide-character-type=yes

or define:

_UNICODE

or:

UNICODE

during compilation.

LIBFSFAT_WIDE_CHARACTER_TYPE in libfsfat/features.h can be used to determine if libfsfat was compiled with wide character support. iykyk. ✨


πŸ’€ BUGS πŸ’€

Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libfsfat/issues

not me asking you to snitch on the bugs but like, do it, it helps. πŸ™ˆ


πŸ‘‘ AUTHOR πŸ‘‘

These man pages are generated from "libfsfat.h".


Copyright (C) 2021-2026, Joachim Metz <joachim.metz@gmail.com>.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ok so fr fr: no warranty, not even for merchantability or fitness for a particular purpose. read that twice bestie. 😭

πŸ¦‹ SEE ALSO πŸ¦‹

  • the libfsfat.h include file

that's the whole page, you ate it πŸ’… and just so you know, this one ships as libfsfat from September 20, 2022, filed under libfsfat(3). periodt. 🫢✨

πŸ“¦ where this page comes from