add modification time fallback if birth time is not supported on this platform
This commit is contained in:
parent
9eb0784f6f
commit
ae1a4fd283
1 changed files with 8 additions and 1 deletions
|
@ -251,7 +251,14 @@ impl Service {
|
|||
let file_metadata = fs::metadata(path.clone()).await?;
|
||||
debug!("File metadata: {:?}", file_metadata);
|
||||
|
||||
let file_created_at = file_metadata.created()?;
|
||||
let file_created_at = match file_metadata.created() {
|
||||
Ok(value) => value,
|
||||
Err(err) if err.kind() == std::io::ErrorKind::Unsupported => {
|
||||
debug!("btime is unsupported, using mtime instead");
|
||||
file_metadata.modified()?
|
||||
},
|
||||
Err(err) => return Err(err.into()),
|
||||
};
|
||||
debug!("File created at: {:?}", file_created_at);
|
||||
|
||||
if file_created_at >= user_duration {
|
||||
|
|
Loading…
Add table
Reference in a new issue