Closed TheBlindM closed 9 months ago
let entries = sftp.read_dir(select_path).await?; let mut files: Vec<_> = entries .into_iter() .map(|entry| { info!( "name:{} isLink:{}", &entry.file_name(), entry.file_type().is_symlink() ); let attributes = entry.metadata(); let r#type = match attributes.file_type() { FileType::Dir => "dir", FileType::File => "file", FileType::Symlink => "symlink", FileType::Other => "other", }; let select_path_copy = select_path_copy.clone(); FileInfo { path: Option::from(select_path_copy + &entry.file_name()), name: Option::from(entry.file_name()), size: attributes.size, r#type: r#type.to_string(), modify_date: attributes.mtime.map(|mtime| { let date_time = Utc.timestamp(mtime as i64, 0); date_time.format("%Y-%m-%d %H:%M:%S").to_string() }), } }) .collect();
Now it is fixed. Will be published in the next version. Thank you