Home

statfstat

Statfstat is a proposed or hypothetical API that consolidates file status retrieval in POSIX-like environments by combining the capabilities of the stat and fstat functions into a single interface. It is not part of the POSIX standard and remains uncommon in mainstream systems as of the current era.

Interface and behavior: In a typical design, statfstat provides two entry points: statfstat_path and statfstat_fd. statfstat_path

Returned data: The struct stat (or a compatible variant) includes file type and permissions (st_mode), size (st_size),

Rationale and use: The unified API simplifies calling code that must handle both path-based and descriptor-based

See also: stat, fstat, lstat, struct stat, statfs.

takes
a
const
char
*path
and
fills
a
struct
stat
with
metadata
about
the
file
identified
by
the
path.
statfstat_fd
takes
an
int
fd
corresponding
to
an
open
file
and
fills
a
struct
stat
with
the
status
of
that
file
descriptor.
Both
return
0
on
success
and
-1
on
error,
setting
errno
similarly
to
stat
and
fstat.
device
and
inode
numbers
(st_dev,
st_ino),
link
count
(st_nlink),
ownership
(st_uid,
st_gid),
and
timestamps
(st_atime,
st_mtime,
st_ctime),
among
others.
The
exact
fields
can
vary
by
implementation
but
generally
align
with
the
standard
struct
stat.
metadata
retrieval,
aids
cross-language
wrappers,
and
can
streamline
portability
layers.
However,
the
lack
of
standardization
means
adoption
depends
on
platform-specific
libraries
or
projects.