Home | Libraries | People | FAQ | More |
Metadata about a directory entry.
This structure looks somewhat like a
, and indeed it
was derived from BSD's struct
stat
. However there
are a number of changes to better interoperate with modern practice, specifically:
struct
stat
std::chrono::system_clock::time_point
or Boost equivalent. The resolution of these may or may not equal what
a struct timespec
can do depending on your STL.
st_type
which is one of
the values from filesystem::file_type
.
st_mode
, instead being
a st_perms
which is solely the permissions bits. If you want to test permission
bits in st_perms
but don't want to include platform specific headers, note that filesystem::perms
contains definitions
of the POSIX permissions flags.
struct stat_t { uint64_t st_dev; // inode of device containing file (POSIX only) uint64_t st_ino; // inode of file (Windows, POSIX) filesystem::file_type st_type; // type of file (Windows, POSIX) filesystem::perms st_perms; // uint16_t bitfield perms of file (POSIX only) int16_t st_nlink; // number of hard links (Windows, POSIX) int16_t st_uid; // user ID of the file (POSIX only) int16_t st_gid; // group ID of the file (POSIX only) dev_t st_rdev; // id of file if special (POSIX only) chrono::system_clock::time_point st_atim; // time of last access (Windows, POSIX) chrono::system_clock::time_point st_mtim; // time of last data modification (Windows, POSIX) chrono::system_clock::time_point st_ctim; // time of last status change (Windows, POSIX) off_t st_size; // file size, in bytes (Windows, POSIX) off_t st_allocated; // bytes allocated for file (Windows, POSIX) off_t st_blocks; // number of blocks allocated (Windows, POSIX) uint16_t st_blksize; // block size used by this device (Windows, POSIX) uint32_t st_flags; // user defined flags for file (FreeBSD, OS X, zero otherwise) uint32_t st_gen; // file generation number (FreeBSD, OS X, zero otherwise) chrono::system_clock::time_point st_birthtim; // time of file creation (Windows, FreeBSD, OS X, zero otherwise) unsigned st_sparse; // if this file is sparse, or this directory capable of sparse files (Windows, POSIX) unsigned st_compressed; // if this file is compressed, or this directory capable of compressed files (Windows) unsigned st_reparse_point; // if this file or directory is a reparse point (Windows) };
Function |
Description |
Parameters |
---|---|---|
stat_t() |
Constructs a UNINITIALIZED instance i.e. full of random garbage. |
|
stat_t(std::nullptr_t ) |
Constructs a zeroed instance. |
std::nullptr_t: : |
#include <boost/afio/v2/afio.hpp>