Jump to content




fs.open("filename", "a") Question

lua help networking

  • You cannot reply to this topic
5 replies to this topic

#1 tfoote

  • New Members
  • 134 posts
  • LocationSalt Lake, UT

Posted 24 June 2012 - 03:23 PM

When using fs.open("filename", "a") do you start writing at the end of the file? I am creating an e-mail server and this is my code so far...
Spoiler


#2 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 24 June 2012 - 03:52 PM

From the wiki:

Quote

"a" to open for writing but keep existing data and append any writes to the end of the file
Is it so hard to go to the wiki and read a little?

#3 tfoote

  • New Members
  • 134 posts
  • LocationSalt Lake, UT

Posted 24 June 2012 - 03:53 PM

I went there... But it didn't say weather it wrote to annother line. That is my problem. I want to know if it continues where it left of or starts a new line

#4 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 24 June 2012 - 03:55 PM

It writes to the end of the file, so if there was a newline character at the end it will start in the next line, otherwise it keeps writing in the same line.

#5 tfoote

  • New Members
  • 134 posts
  • LocationSalt Lake, UT

Posted 24 June 2012 - 04:01 PM

Thank you

#6 Bossman201

  • New Members
  • 92 posts

Posted 24 June 2012 - 11:14 PM

Try:
file.writeLine(message)


View PostMysticT, on 24 June 2012 - 03:55 PM, said:

It writes to the end of the file, so if there was a newline character at the end it will start in the next line, otherwise it keeps writing in the same line.
Also, the newline character is "n".





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users