---
title: directoryForTemporaryFiles
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avassetwriter/directoryfortemporaryfiles
---

# directoryForTemporaryFiles

A directory to contain temporary files that the export process generates.

## Declaration

```swift
var directoryForTemporaryFiles: URL? { get set }
```

## Discussion

Discussion In some configurations, such as performing multipass encoding, an asset writer may need to write temporary files. Use this property value to set the file-system location where it writes temporary files. The system deletes all temporary files after it finishes writing successfully, fails, or you cancel the writing session. You can set this value after writing starts.

## See Also

### Configuring output

- [metadata](avfoundation/avassetwriter/metadata.md)
- [shouldOptimizeForNetworkUse](avfoundation/avassetwriter/shouldoptimizefornetworkuse.md)
