[Solved] Remove text? RandomAccessFile

Discussion in 'Plugin Development' started by Hello Minecraft World, Feb 19, 2012.

Thread Status:
Not open for further replies.
  1. I'm trying to remove all text in a RandomAccessFile because if i do:
    new RandomAccessFile(file, "rw").writeUTF("Test String");
    it won't replace current so if the file contains Test String!
    and i use the above code it will become the same
    any idea how to fix?

    Wait found out using:
    @SuppressWarnings("unused")
    FileOutputStream fos = new FileOutputStream(file);
    before the writing because this code will make a new file (took it from where i make the file if it doesn't exist)
    and the new file will be empty

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
Thread Status:
Not open for further replies.

Share This Page