---
title: currentDirectory()
framework: foundation
role: symbol
role_heading: Type Method
path: foundation/url/currentdirectory()
---

# currentDirectory()

Returns the working directory of the current process.

## Declaration

```swift
static func currentDirectory() -> URL
```

## Return Value

Return Value Calling this method issues a getcwd system call. This method’s return value can change between calls because any thread can change the process’s current working directory at any time. Take precautions when reasoning about the current directory in a multithreaded environment.

## See Also

### Accessing home and user directories

- [homeDirectory](foundation/url/homedirectory.md)
- [homeDirectory(forUser:)](foundation/url/homedirectory(foruser:).md)
