Posted 01 May 2013 - 11:59 AM
because i have a program that uses fs api but i dont know how it use it to edit programs.. like startups, programms and more
local file = fs.open("startup", "w")
file.write([[--Use multi string lines
--for it to be
--spread over
--multiple lines
print("hi")]])
file.close()
local file = fs.open("startup", "a")
file.write([[--This text
--should be found at the end of the startup file
print("Appended successfully!")]])
file.close()
To open a file, clear it and then write use "w" modelocal file = fs.open("startup", "w") file.write([[--Use multi string lines --for it to be --spread over --multiple lines print("hi")]]) file.close()
Use "a" mode to append to the file.local file = fs.open("startup", "a") file.write([[--This text --should be found at the end of the startup file print("Appended successfully!")]]) file.close()