---
title: "homeDirectory(forUser:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/url/homedirectory(foruser:)"
---

# homeDirectory(forUser:)

Returns the home directory for the specified user.

## Declaration

```swift
static func homeDirectory(forUser user: String) -> URL?
```

## Parameters

- `user`: The system user name for a given user.

## Return Value

Return Value The home directory for the specified user.

## See Also

### Accessing home and user directories

- [currentDirectory()](foundation/url/currentdirectory().md)
- [homeDirectory](foundation/url/homedirectory.md)
