Re: Can't Use java.io.FileInputStream Within Cocoa
Re: Can't Use java.io.FileInputStream Within Cocoa
- Subject: Re: Can't Use java.io.FileInputStream Within Cocoa
- From: John Timmer <email@hidden>
- Date: Sat, 14 Jul 2001 09:39:33 -0400
If I'm looking to get at a in a location relative to my application, I've
had the best luck picking a file in my NSBundle and then working out the
path based on a the path to that (this is in Java).
Jay
>
I have found a very peculiar bug when using the java.io.FileInputStream
>
within a java cocoa app. I'm trying to read a text file line by line, so
>
I have to use the java.io classes here (correct me if there is a Java
>
compatible Cocoa API that I can use instead). This is the gist of the
>
code for opening the file stream, pretty standard.
>
>
File inputFile = new File("input.txt");
>
FileInputStream in = new FileInputStream(inputFile);
>
>
The text file input.txt is within the same folder as the application
>
itself, so the path for inputFile is correct.