Results 1 to 2 of 2
  1. #1
    mathias is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default Help with write file in java

    Hi, I having a bit of a problem figuring out what to do.
    All i need to do is delete file,create new file,write container data to file.
    Just something small will be helpful.

    Thanks.

  2. #2
    brianhks is offline Senior Member
    Join Date
    Jul 2007
    Posts
    135
    Rep Power
    0

    Default

    java.io.File.delete() will delete a file.

    PrintWriter pw = new PrintWriter(new FileWriter("FileName"))
    is a good way to write a file.

Similar Threads

  1. how to write onto a file
    By mirage_87 in forum New To Java
    Replies: 6
    Last Post: 09-08-2009, 03:54 PM
  2. Replies: 1
    Last Post: 01-29-2009, 09:35 AM
  3. how do i write to a text file from an arraylist?
    By otoro_java in forum New To Java
    Replies: 3
    Last Post: 01-30-2008, 06:53 AM
  4. File Write Error
    By vikain in forum Advanced Java
    Replies: 5
    Last Post: 01-02-2008, 04:38 AM
  5. Write unicode into file
    By vata2999 in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 03:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •