appendfile

appendfile

function appendfile( path, data [, prefix [, suffix]] ) --> res, err

Description

This function will append some data to the file at the specified path.

Parameters

path

Path to the file to modify.

data

Chunks of data to add at end of file. It can be a table of string or a single string (in case of single chunk).

prefix

Data to be written before each chunk of data.

suffix

Data to be written after each chunk of data.

Return Values

res

true or nil if an error occurse.

err

A message if an error occurse, otherwise nil.

Code

include:appendfile.lua[]

Examples

include:appendfile.ex1.lua[]

See also