Im trying to make a email system that stores the email in a file
but i have some questions:
How do i change what line it write on?
why dosnt it write but just create the file when i want it to print on a disk?
how do i make it read from a line?
any help would be appreciated =)
File options (Need help)
Started by gheotic, Jan 23 2013 05:59 AM
5 replies to this topic
#1
Posted 23 January 2013 - 05:59 AM
#2
Posted 23 January 2013 - 06:15 AM
file = fs.open("file", "w")
file.write() --- write a line to the file and go to the next line
file = fs.open("file, "r")
file.read() --- read all the file
file.readLine() --- reads the next line of the file and go to the next line
file.write() --- write a line to the file and go to the next line
file = fs.open("file, "r")
file.read() --- read all the file
file.readLine() --- reads the next line of the file and go to the next line
#3
Posted 23 January 2013 - 08:12 AM
remember to close the file handles!
file.close()
file.close()
#4
Posted 23 January 2013 - 07:50 PM
so if i want to make my program write emails down to the file on each line
how do i chose which line it should read?
how do i chose which line it should read?
#5
Posted 23 January 2013 - 07:58 PM
urielsalis, on 23 January 2013 - 06:15 AM, said:
file.write() --- write a line to the file and go to the next line
urielsalis, on 23 January 2013 - 06:15 AM, said:
file.read() --- read all the file
gheotic, on 23 January 2013 - 07:50 PM, said:
how do i chose which line it should read?
Edited by TheOriginalBIT, 23 January 2013 - 08:01 PM.
#6
Posted 23 January 2013 - 10:04 PM
Or you could use file.writeLine("text") which inserts a new line automatically
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











