Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Reading Files in Java

Name: Anonymous 2010-11-27 12:30

Whenever I read a file in java I always have to put the text file in some arbitrary folder. How can I make my program read/writes files from the same folder that its in.

I want this to work so that even if its moved to another folder or computer, it still works.

Name: Anonymous 2010-11-27 13:34

I'm not really understanding what you guys are suggesting.

How would I make this:
String fileName="src/className/SetupFileInfo.txt";
BufferedReader br = null;       
FileReader fr = new FileReader(fileName);
br = new BufferedReader(fr);

not point to an absolute path exactly?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List