# PetscGetHomeDirectory
Returns home directory name. 
## Synopsis
```
PetscErrorCode PetscGetHomeDirectory(char dir[], size_t maxlen)
```
Not Collective


## Input Parameter

- ***maxlen -*** maximum length allowed



## Output Parameter

- ***dir -*** contains the home directory. Must be long enough to hold the name.





## Notes
If PETSc cannot determine the home directory it makes dir a null string

On Windows machines the environmental variable `HOME` specifies the home directory.


## See Also
 `PetscGetTmp()`, `PetscSharedTmp()`, `PetscGetWorkingDirectory()`

## Level
developer

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/fileio/ghome.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)  
