# PetscFileRetrieve
Obtains a file from a URL or compressed and copies into local disk space as uncompressed. 
## Synopsis
```
PetscErrorCode PetscFileRetrieve(MPI_Comm comm, const char url[], char localname[], size_t llen, PetscBool *found)
```
Collective


## Input Parameters

- ***comm     -*** processors accessing the file
- ***url      -*** name of file, including entire URL (with or without .gz)
- ***llen     -*** length of localname



## Output Parameters

- ***localname -*** name of local copy of file - valid on only process zero
- ***found -*** if found or retrieved the file - valid on all processes



## Note
if the file already exists local this function just returns without downloading it.



## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/fileio/fretrieve.c.html#PetscFileRetrieve">src/sys/fileio/fretrieve.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/extchem.c.html">src/ts/tutorials/extchem.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/fileio/fretrieve.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
