---
title: "fwrite | open.mp"
description: "Schrijf tekst naar een bestand."
canonical: https://omp.itsneufox.com/nl/docs/scripting/functions/fwrite
language: nl
---

# fwrite

## Beschrijving

Schrijf tekst naar een bestand.

| Naam | Beschrijving |
| --- | --- |
| File:handle | Handle van het bestand (van fopen). |
| const string\[\] | De te schrijven tekst. |

## Retourneert

De lengte van de geschreven string (integer).

## Voorbeeld

```c
new File:handle = fopen("file.txt", io_append);
if (handle)
{
    fwrite(handle, "This is a text.\r\n");
    fclose(handle);
}
```

## Gerelateerde Functies

-   [fopen](https://omp.itsneufox.com/nl/docs/scripting/functions/fopen): Een bestand openen (lezen/schrijven).
-   [fread](https://omp.itsneufox.com/nl/docs/scripting/functions/fread): Lees één regel uit een bestand.
