fn remove_with_permission_check<F, P>(remove_func: F, p: P) -> Result<()>where F: Fn(P) -> Result<()>, P: AsRef<Path> + Clone,