Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file io

Status
Not open for further replies.

ArmenD

Programmer
Feb 3, 2005
101
US
hi,
so i am trying to write to a file that i have created, but am recieving...
excpetion caught java.io.FileNotFoundException: OUTPUT (The system cannot find the file specified)

but i create this file with...
File outputFile = new File(outputfile);
try {
BufferedReader in = new BufferedReader(new FileReader(outputFile));
}
catch...

could it be a directory problem? if so, this is a standalone app that needs to run on other ppl's desktops, how would i be able to find a universal path to save this file into?
 
sorry was missing the following line...
outputFile.createNewFile();
 
for DataOutputStream out = new...
after out.write(...) do i need to do out.flush to see outuput in file?

i am getting wierd chars written to my file.
 
You should always flush any IO stream before you close.

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top