fn mount_and_cp()

in src/fs.rs [1139:1173]


    fn mount_and_cp<'a>() {
        init();

        let dir = tempfile::Builder::new()
            .prefix("mount_and_cp")
            .tempdir()
            .unwrap();

        let output_dir = tempfile::Builder::new()
            .prefix("mount_and_cp_output")
            .tempdir()
            .unwrap();

        let mnt = dir.into_path();
        let mnt_str = String::from(mnt.to_str().unwrap());
        let daemon = mount_tempdir_ro(mnt);

        info!("mounted fs at {} in thread {:#?}", mnt_str, daemon);

        let tif_file = LANDSAT_B7_TIF;
        let sub_dir = LANDSAT_SUBDIR;
        let full_path = format!("{}/{}/{}", mnt_str, sub_dir, tif_file);
        let dst_path = format!("{}/{}", output_dir.path().to_str().unwrap(), tif_file);

        let stat_time = std::time::Instant::now();
        info!("Calling stat to trigger init");
        run_stat(&full_path, &mnt_str);
        info!("stat completed in {:#?}", stat_time.elapsed());

        let now = std::time::Instant::now();
        run_cp(&full_path, &dst_path, &mnt_str);

        println!("cp took {:#?}", now.elapsed());
        drop(daemon);
    }