• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Can't Use java.io.FileInputStream Within Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Can't Use java.io.FileInputStream Within Cocoa (From: Orbital Media Design <email@hidden>)

  • Prev by Date: Fwd: Saving TIFF
  • Next by Date: AuthorizationCreate
  • Previous by thread: Re: Can't Use java.io.FileInputStream Within Cocoa
  • Next by thread: Re: Can't Use java.io.FileInputStream Within Cocoa
  • Index(es):
    • Date
    • Thread