Structstd::fs::Metadata 1.0.0·source· pub struct Metadata(_); 有关文件的元数据信息。 此结构体是从metadata或symlink_metadata函数或方法返回的,表示有关文件的已知元数据,例如其权限,大小,修改时间等。 Implementations 1.1.0·source pub fnfile_type(&self) ->FileType ...
use std::io; use std::fs; use std::os::windows::prelude::*; fn main() -> io::Result<()> { let metadata = fs::metadata("foo.txt")?; let creation_time = metadata.creation_time(); Ok(()) }source fn last_access_time(&self) -> u64 返回此元数据的 ftLastAccessTime 字段的值...
Location std::fs::DirEntry::metadata Summary When using thestd::fs::DirEntry::metadatafunction on Windows, the metadata returned by a DirEntry might be different than the actual file metadata. This can be seen in the following code: fnmain(){std::fs::write("./tmp/file1","file 1 conten...