Luart
Comprehensive Windows framework to develop in Lua
modules > sys > File > write

File : write (data) method

Writes data to the file.

Parameters

data

A variable converted to a string value to be written to the file.

Return value

Returns the number of bytes written to the file.

Example


local console = require "console"

-- create a Buffer with bytes indicating "Ltf8 string 
local msg = sys.Buffer("4CC3BBC3A4", "hex")

-- write the Buffer to the console.stdout standard File
console.stdout:write(msg)