👎Deprecated since 1.8.0: other methods of this trait are now preferred
Gain a reference to the underlying stat structure which contains
the raw information returned by the OS.
The contents of the returned stat are not consistent across
Unix platforms. The os::unix::fs::MetadataExt trait contains the
cross-Unix abstractions contained within the raw stat.
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let stat = meta.as_raw_stat();
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_dev());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_ino());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_mode());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_nlink());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_uid());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_gid());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_rdev());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_size());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_atime());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_atime_nsec());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_mtime());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_mtime_nsec());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_ctime());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_ctime_nsec());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_blksize());
Ok(())
}
use std::fs;
use std::io;
use std::os::linux::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
println!("{}", meta.st_blocks());
Ok(())
}