clvm_tools_rs 0.4.0

tools for working with chialisp language; compiler, repl, python and wasm bindings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::fs;

pub fn newer(input_path: &str, output_path: &str) -> Result<bool, String> {
    if !std::path::Path::new(output_path).exists() {
        return Ok(true);
    }

    fs::metadata(input_path)
        .map_err(|_| "source does not exist".to_string())
        .and_then(|im| {
            fs::metadata(output_path)
                .map(|om| im.modified().unwrap() >= om.modified().unwrap())
                .map_err(|_| "could not stat dest".to_string())
        })
}