Results 1 to 4 of 4
  1. #1
    Jessaurum is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default Where is output.txt?

    I created a FileWriter called outstream, and so I specified its destination as:

    outStream = new FileWriter("output.txt");

    I was able to run my program without any bugs, but now I have no clue as to where the output was actually written. I'm currently using Windows Vista, and I'm using Eclipse 3.5 Galileo.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Put in the line:
    Java Code:
    System.out.println("user.dir");
    And then check out that directory

  3. #3
    Jessaurum is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default

    I tried to use that line, without the quotes as well, but it didn't understand what user was. I'm not sure if that means to replace user with my own username, but I don't know what that is either. Thanks, though.

    I figured out a different solution. I ended up just going to File -> Open File, then I just inserted into the search box to find it on my computer. I'm still puzzled as to why it wasn't in a more obvious place.

  4. #4
    CodesAway's Avatar
    CodesAway is offline Senior Member
    Join Date
    Sep 2009
    Location
    Texas
    Posts
    238
    Rep Power
    6

    Default

    "user.dir" is a property - retrieved via System.getProperty.

    The posted code didn't call the method, it was a typo.

    Run this line (exactly as is) - that's where the file will be saved.
    Java Code:
    System.out.println(System.getProperty("user.dir"));
    CodesAway - codesaway.info
    writing tools that make writing code a little easier

Similar Threads

  1. Java, output string, getting correct output? HELP!
    By computerboyo in forum New To Java
    Replies: 2
    Last Post: 02-25-2009, 11:44 PM
  2. what the outPut
    By alksam in forum Advanced Java
    Replies: 5
    Last Post: 12-25-2008, 01:44 PM
  3. different output
    By pro85 in forum Java Applets
    Replies: 6
    Last Post: 08-05-2008, 01:42 PM
  4. Why the output is always zero
    By mehrotra.chitij in forum New To Java
    Replies: 12
    Last Post: 04-25-2008, 04:05 AM

Posting Permissions

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