ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
protocore_mnt_stat Struct Reference

What a stat and a directory entry both answer: the facts about one file, and no name. More...

#include <mnt.h>

Public Attributes

proto_bool is_dir
 
uint64_t size
 0 for a directory
 
uint32_t mtime
 unix epoch seconds, 0 if the backend keeps no timestamp
 

Detailed Description

What a stat and a directory entry both answer: the facts about one file, and no name.

The name is deliberately absent. A name buffer welded into this struct would set one length for every consumer, and the consumers do not agree: the SFTP codec sizes its entry scratch from what one NAME response must hold, WebDAV from an href, the RAM backend from its own file table. Each translation unit derives the length it needs and passes a buffer, so this type stays the four facts and carries no policy.

Stat and readdir share it because they answer the same question about the same directory record

  • asking a backend for a size, then whether it is a directory, then its mtime is three lookups of one record, which on FAT is three seeks to learn what the first read already had.

Definition at line 70 of file mnt.h.

Member Data Documentation

◆ is_dir

proto_bool protocore_mnt_stat::is_dir

Definition at line 72 of file mnt.h.

◆ size

uint64_t protocore_mnt_stat::size

0 for a directory

Definition at line 73 of file mnt.h.

◆ mtime

uint32_t protocore_mnt_stat::mtime

unix epoch seconds, 0 if the backend keeps no timestamp

Definition at line 74 of file mnt.h.


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