ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_fs_stat_t Struct Reference

What ra8_fs_stat() read out of a directory entry. More...

#include <ra8_fs_types.h>

Collaboration diagram for ra8_fs_stat_t:

Data Fields

uint64_t size_bytes
 File length in bytes; 0 for a directory.
uint32_t first_cluster
 Head of the entry's cluster chain (0 if empty).
ra8_fs_timestamp_t created
 Creation timestamp, or invalid for the root.
ra8_fs_timestamp_t modified
 Last-modified timestamp.
ra8_fs_timestamp_t accessed
 Last-accessed timestamp (date-only on FAT).
uint8_t attr
 The entry's own FAT attribute byte.
bool is_directory
 true => the ATTR_DIRECTORY bit is set.

Detailed Description

What ra8_fs_stat() read out of a directory entry.

The on-disk facts about one name, reported without opening it. That distinction is the point of the struct: a directory has no file handle to open and a metadata query must not consume one of the four file slots, so everything here comes from the directory entry itself.

Invariant
is_directory is exactly (attr & k_ra8_fs_attr_directory) != 0.
size_bytes is 0 whenever is_directory is true – a FAT directory's DIR_FileSize is defined to be 0, and its real extent is its cluster chain.
Example:
ra8_fs_stat_t st = {};
if (ra8_fs_stat(mnt, "/books", &st) == k_ra8_ok && st.is_directory) {
(void)ra8_fs_listdir(mnt, "/books", on_entry, nullptr);
}
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
Definition ra8_err.h:119
ra8_err_t ra8_fs_listdir(const ra8_fs_mount_t *handle, const char *path, ra8_fs_listdir_cb_t cb, void *ctx)
Enumerate directory entries; invoke cb once per visible entry.
ra8_err_t ra8_fs_stat(const ra8_fs_mount_t *handle, const char *path, ra8_fs_stat_t *out)
Report what a path names – file or directory – without opening it.
What ra8_fs_stat() read out of a directory entry.
bool is_directory
true => the ATTR_DIRECTORY bit is set.
See also
ra8_fs_stat() Fills this in.
Since
0.1.0

Definition at line 396 of file ra8_fs_types.h.

Field Documentation

◆ accessed

ra8_fs_timestamp_t ra8_fs_stat_t::accessed

Last-accessed timestamp (date-only on FAT).

Definition at line 401 of file ra8_fs_types.h.

Referenced by internal_stat_exfat_times(), internal_stat_fat_times(), and ra8_io_vfs_stat().

◆ attr

uint8_t ra8_fs_stat_t::attr

The entry's own FAT attribute byte.

Definition at line 402 of file ra8_fs_types.h.

Referenced by internal_entry_to_stat(), internal_stat_exfat(), internal_stat_root(), internal_stub_stat(), and ra8_io_vfs_stat().

◆ created

ra8_fs_timestamp_t ra8_fs_stat_t::created

Creation timestamp, or invalid for the root.

Definition at line 399 of file ra8_fs_types.h.

Referenced by internal_stat_exfat_times(), internal_stat_fat_times(), and ra8_io_vfs_stat().

◆ first_cluster

uint32_t ra8_fs_stat_t::first_cluster

Head of the entry's cluster chain (0 if empty).

Definition at line 398 of file ra8_fs_types.h.

Referenced by internal_entry_to_stat(), internal_stat_exfat(), and internal_stat_root().

◆ is_directory

bool ra8_fs_stat_t::is_directory

true => the ATTR_DIRECTORY bit is set.

Definition at line 403 of file ra8_fs_types.h.

Referenced by internal_entry_to_stat(), internal_stat_exfat(), internal_stat_root(), internal_stub_stat(), and ra8_io_vfs_stat().

◆ modified

ra8_fs_timestamp_t ra8_fs_stat_t::modified

Last-modified timestamp.

Definition at line 400 of file ra8_fs_types.h.

Referenced by internal_stat_exfat_times(), internal_stat_fat_times(), and ra8_io_vfs_stat().

◆ size_bytes

uint64_t ra8_fs_stat_t::size_bytes

File length in bytes; 0 for a directory.

Definition at line 397 of file ra8_fs_types.h.

Referenced by internal_entry_to_stat(), internal_stat_exfat(), internal_stat_root(), internal_stub_stat(), and ra8_io_vfs_stat().


The documentation for this struct was generated from the following file: