How to record to a .txt file?

Discussion in 'Plugin Development' started by nicksroom10, Oct 22, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    nicksroom10

    What I want to do is, when a player logs in, record in a .txt file which user logged in and what time it was. But how would I go about making it record to this text file? I'm pretty sure I know how to make it create it.
    Thanks for anyone's help. :)
     
  2. Offline

    Forairan

    Code:
    File file = new File("stuff.txt", true);
    if (!file.exists()) {
      file.createNewFile();
    }
    BufferedWriter bw = new BufferedWriter(new FileWriter(file));
    bw.write("stuff\n");
    bw.close();
    Something like that.
     
  3. Offline

    nicksroom10

    Yeah, I figured it out, and that's basically what I have.
    Thanks anyways! :)
     
Thread Status:
Not open for further replies.

Share This Page