file.file.set_line
Declaration
lua
file.set_line(path, line_number, content)
Description
Replace specific line. 0=append to end. Pads with empty lines if beyond file length.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | Required | — | |
line_number | integer | Required | — | 1-based, 0=append |
content | string | Required | — | New line content |
Return Values
| Type | Description |
|---|---|
| boolean |
Example
lua
file.set_line("data.txt", 1, "new first line")