use std::io;
use std::fs;
use std::os::unix::fs::MetadataExt;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let dev_id = meta.dev();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let inode = meta.ino();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let mode = meta.mode();
let user_has_write_access = mode & 0o200;
let user_has_read_write_access = mode & 0o600;
let group_has_read_access = mode & 0o040;
let others_have_exec_access = mode & 0o001;
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let nb_hard_links = meta.nlink();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let user_id = meta.uid();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let group_id = meta.gid();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let device_id = meta.rdev();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let file_size = meta.size();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let last_access_time = meta.atime();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let nano_last_access_time = meta.atime_nsec();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let last_modification_time = meta.mtime();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let nano_last_modification_time = meta.mtime_nsec();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let last_status_change_time = meta.ctime();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let nano_last_status_change_time = meta.ctime_nsec();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let block_size = meta.blksize();
Ok(())
}
use std::fs;
use std::os::unix::fs::MetadataExt;
use std::io;
fn main() -> io::Result<()> {
let meta = fs::metadata("some_file")?;
let blocks = meta.blocks();
Ok(())
}