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
how do you edit a file using fs api?
Started by thegreatstudio, May 01 2013 10:59 AM
2 replies to this topic
#1
Posted 01 May 2013 - 10:59 AM
#2
Posted 01 May 2013 - 11:04 AM
To open a file, clear it and then write use "w" mode
Use "a" mode to append to the file.
local 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()
#3
Posted 01 May 2013 - 11:23 AM
remiX, on 01 May 2013 - 11:04 AM, said:
To open a file, clear it and then write use "w" mode
Use "a" mode to append to the file.
local 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()you are a great help remix! Thanks for your answer
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











