Like:
fs.open("test", w)
code to write the program
fs.close
Posted 23 April 2013 - 06:16 AM
fs.open("test", w)
code to write the program
fs.close
Posted 23 April 2013 - 06:18 AM
local handle = io.open("outfile", "w")
if handle then
handle:write([[
print("Hello, World!")
]])
handle:close()
end
Posted 23 April 2013 - 06:19 AM
local f = io.open("test", "w")
f:write([[
-- program code here
print("Hello from test!")
]])
f:close()
Posted 23 April 2013 - 06:21 AM
Posted 23 April 2013 - 06:23 AM
local handle = io.open("outfile", "w")
if handle then
handle:write(
[[
-- Declare a function
local function foo( s )
print( s )
end
foo( "Hello!" )
]])
handle:close()
end
Posted 23 April 2013 - 06:31 AM
local f = fs.open("startup", w)
f:write([[
print"Starting...."
sleep(1)
]])
f:close()
With this code I get:Posted 23 April 2013 - 06:32 AM
Posted 23 April 2013 - 06:37 AM
Posted 23 April 2013 - 06:49 AM
local f = fs.open("startup","w")
w.write([[print"Starting...."
sleep(1)]]
)
w.close()
Posted 23 April 2013 - 06:51 AM
Posted 23 April 2013 - 07:06 AM
0 members, 1 guests, 0 anonymous users