Writes the specified text to a file.
- Namespace
- Statiq
.Testing - Containing Type
- TestFile
- Implements
Syntax
public Task WriteAllTextAsync(string contents, bool createDirectory = true, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Name | Type | Description |
|---|---|---|
| contents | string | The text to write. |
| createDirectory | bool | Will create any needed directories that don't already exist if set to true. |
| cancellationToken | CancellationToken | A cancellation token. |
Return Value
| Type | Description |
|---|---|
| Task |