fn open_to_and_set_permissions(
    to: &Path,
    reader_metadata: Metadata
) -> Result<(File, Metadata)>