fn check_vhost_file_access(host_file_location: &String) -> Result<()> {
    let contents = fs::read_to_string(host_file_location)
        .with_context(|| format!("Unable to open {}",  host_file_location))?;
    let mut file = OpenOptions::new().write(true).truncate(true).open(host_file_location)?;
    file.write(contents.as_bytes())
        .with_context(|| format!("Unable to write to file {}", host_file_location))?;
    file.sync_all()?;
    Ok(())
}
// Checks access to the vhost file by attempting to read and write from it.
Checks access to the vhost file by attempting to read and write from it.
Checks access to the vhost file by attempting to read and write from it .
fn check_vhost_file_access(host_file_location: &String) -> Result<()> {
    let contents = fs::read_to_string(host_file_location)
        .with_context(|| format!("Unable to open {}",  host_file_location))?;
    let mut file = OpenOptions::new().write(true).truncate(true).open(host_file_location)?;
    file.write(contents.as_bytes())
        .with_context(|| format!("Unable to write to file {}", host_file_location))?;
    file.sync_all()?;
    Ok(())
}
fn check_vhost_file_access ( host_file_location : & String ) -> Result < ( ) > { let contents = fs :: read_to_string ( host_file_location ) . with_context ( | | format ! ( " " host_file_location ) ) ? ; let mut file = OpenOptions :: new ( ) . write ( true ) . truncate ( true ) . open ( host_file_location ) ? ; file . write ( contents . as_bytes ( ) ) . with_context ( | | format ! ( " " host_file_location ) ) ? ; file . sync_all ( ) ? ; Ok ( ( ) ) }
Checks access to the vhost file by attempting to read and write from it.
Checks access to the vhost file by attempting to read and write from it .
host_file_location
&String
host_file_location
&String