faio
faio 公共 C++ 接口参考
载入中...
搜索中...
未找到
faio::fs::Metadata类 参考

文件类型、大小、权限和时间信息。 更多...

Public 成员函数

std::uint64_t len () const noexcept
 查询元数据记录的文件长度。
bool is_file () const noexcept
 判断元数据是否为普通文件。
bool is_dir () const noexcept
 判断元数据是否为目录。
bool is_symlink () const noexcept
 判断元数据是否为符号链接。
Permissions permissions () const noexcept
 读取当前权限值。
bool same_file (const Metadata &other) const noexcept
 比较两份元数据是否标识同一文件。
std::filesystem::file_type file_type () const noexcept
 查询文件系统类型。
std::chrono::system_clock::time_point modified () const noexcept
 取得元数据快照中的修改时间。
std::chrono::system_clock::time_point accessed () const noexcept
 取得元数据快照中的访问时间。

详细描述

文件类型、大小、权限和时间信息。

公共头文件
#include <faio/fs/path.hpp>

成员函数说明

◆ len()

std::uint64_t faio::fs::Metadata::len ( ) const
noexcept

查询元数据记录的文件长度。

返回
返回字节数。

◆ is_file()

bool faio::fs::Metadata::is_file ( ) const
noexcept

判断元数据是否为普通文件。

返回
返回 bool。

◆ is_dir()

bool faio::fs::Metadata::is_dir ( ) const
noexcept

判断元数据是否为目录。

返回
返回 bool。

◆ is_symlink()

bool faio::fs::Metadata::is_symlink ( ) const
noexcept

判断元数据是否为符号链接。

返回
返回 bool;跟随链接得到的元数据描述目标对象。

◆ permissions()

Permissions faio::fs::Metadata::permissions ( ) const
noexcept

读取当前权限值。

返回
返回 Permissions,文件异步查询重载返回 expected<Permissions>。

◆ same_file()

bool faio::fs::Metadata::same_file ( const Metadata & other) const
noexcept

比较两份元数据是否标识同一文件。

参数
other被复制、移动或比较的同类型对象;移动后源对象按该类型约定变空。
返回
返回 bool。

◆ file_type()

std::filesystem::file_type faio::fs::Metadata::file_type ( ) const
noexcept

查询文件系统类型。

返回
返回 file_type;异步条目查询返回 expected<file_type>。

◆ modified()

std::chrono::system_clock::time_point faio::fs::Metadata::modified ( ) const
noexcept

取得元数据快照中的修改时间。

返回
返回 system_clock::time_point;不执行新的系统查询。

◆ accessed()

std::chrono::system_clock::time_point faio::fs::Metadata::accessed ( ) const
noexcept

取得元数据快照中的访问时间。

返回
返回 system_clock::time_point;不执行新的系统查询。