:orphan:
# PetscGetHomeDirectory
Returns the name of the user's home directory 
## 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` an empty string

On Microsoft 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](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
