# fileFlush (Shared)

> Writes to disk what was written to the file and is still in memory.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Files
- **URL**: https://wiki.mymp.gg/en/fileFlush

## Syntax

```lua
bool fileFlush(file file)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `file` | `file` | A file opened by `fileOpen` or `fileCreate`. |

## Returns

`true` if it worked.

## Example

```lua
fileWrite(log, "checkpoint\n")
fileFlush(log)
```

## See also

- [fileWrite (Shared)](https://wiki.mymp.gg/en/fileWrite.md): Writes one or more texts to a file, at the current position.
- [fileClose (Shared)](https://wiki.mymp.gg/en/fileClose.md): Closes a file, writing what is left, and destroys its element.
