Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By JosAH

Thread: keep open the file written by the filewriter at execution

  1. #1
    noobplus's Avatar
    noobplus is offline Senior Member
    Join Date
    Feb 2012
    Location
    chennai,south of India(south east of asia)
    Posts
    232
    Rep Power
    3

    Default keep open the file written by the filewriter at execution

    Hi,
    I've written the text-file using FileWriter and BufferedWriter
    It runs well, and the file is stored in the eclipse project directory
    (the text file is editable through a notepad/wordpad)

    I need to keep it opened after the program has run. Is it possible?

    regards
    dhilip

  2. #2
    mwr1976 is offline Senior Member
    Join Date
    Oct 2011
    Posts
    106
    Rep Power
    0

    Default Re: keep open the file written by the filewriter at execution

    Why? You always want to close it after you are done writing. leaving it open can give you unexpected results!

  3. #3
    Sierra is offline AN21XX
    Join Date
    Mar 2012
    Location
    Munich
    Posts
    297
    Rep Power
    3

    Default Re: keep open the file written by the filewriter at execution

    I agree: maybe you should state what you want to do, you might have the wrong approach. ;)
    And there is no way I know to do so...

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,023
    Blog Entries
    7
    Rep Power
    20

    Default Re: keep open the file written by the filewriter at execution

    Quote Originally Posted by noobplus View Post
    I need to keep it opened after the program has run. Is it possible?
    It isn't possible; when a process terminates the OS closes all streams owned by the process (but doesn't flush their buffers if any).

    kind regards,

    Jos
    noobplus likes this.
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. First Element of Array being written to file twice Help
    By kingkongjaffa in forum New To Java
    Replies: 1
    Last Post: 08-16-2011, 12:10 AM
  2. FileWriter editing hosts file Mac
    By danborgir in forum New To Java
    Replies: 2
    Last Post: 01-12-2011, 11:23 AM
  3. write to file with filereader/filewriter
    By LennyKosmos in forum New To Java
    Replies: 3
    Last Post: 10-27-2010, 08:12 PM
  4. Replies: 4
    Last Post: 12-03-2008, 11:07 PM
  5. Text file over written
    By bugger in forum New To Java
    Replies: 2
    Last Post: 11-11-2007, 07:32 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
  •