s3sync 1.58.6

Reliable, flexible, and fast synchronization tool for S3.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::path::PathBuf;

#[allow(dead_code)]
pub fn is_file_exist(file_path: &str) -> Result<String, String> {
    let file_path = PathBuf::from(file_path);

    if file_path.exists() && file_path.is_file() {
        Ok(file_path.to_string_lossy().to_string())
    } else {
        Err(format!("File does not exist: {}", file_path.display()))
    }
}