---
title: "fileTruncate"
canonical: "https://support.appfire.com/space/PSJ/509116771/fileTruncate"
format: markdown
---
> Macro (aura-html)

> Macro (button-handy)



> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | fileTruncate(file) | **Package** | file |
> | **Alias** |  | **Pkg Usage** | truncate(file) |

## Description

> Macro (excerpt)
> 
> Clears the content of the specified file. Creates a new file if the one you want to clear content for doesn’t exist.

Clears the content of the specified file. Creates a new file if the one you want to clear content for doesn’t exist.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | file | String | Yes | Name of the file you want to truncate. |

## Return Type

Returns **true** if the file is truncated.

## Example

### Example 1

```
use "file";
truncate("fileToTruncate.txt");;

fileTruncate("fileToTruncate.txt");
```

## See also

> Macro (contentbylabel)