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


|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | fileWrite(fid, string_byte_or_bytearray) | **Package** | file |
| **Alias** |  | **Pkg Usage** | open(fid, string_byte_or_bytearray) |

## Description

> Macro (excerpt)
> 
> Writes text or byte data to an open file.

Writes text or byte data to an open file.

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| fid | String | Yes | The id of the open file to write to. |
| string_byte_or_bytearray | String/Byten | Yes | The text string or byte data to write to the file. |

## Return Type

**None**

Return value has no meaning.

## Error Handling

Throws **String**


 Error: "write_error": followed by the actual error
 


## Example

### Example 1

```javascript
use "file";
int fid = open(filename); //fileOpen
fileWrite(fid, "First line is here
"); //full name of the function
write(fid, "Second line is here
");
close(fid); //fileClose
```

## See also

> Macro (contentbylabel)