I'm trying to read a file creation time if it exists on Linux. I know that it normally will not. But, I'd like to be able to trap for it not existing and still read all the other file dates.
Right now I get the error "creation time is not available on this platform currently" for each file and get no other data on the file I want to collect.
How do I handle this error gracefully on each file if creation time does not exist and still be able to report other data such as md5, modified time, ...?
fn format_date(time: DateTime) -> Result<String, std::io::Error> {
Ok(time.format("%Y-%m-%d %H:%M:%S.%3f").to_string())
}
let ctime = format_date(file.metadata()?.created()?.into())?;
thanks