Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Where does an program look for the connector object with file?

 
Charlie Swan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I am using the below statement:

conn = (StreamConnection)Connector.open("file:/Stats.txt");

in what directory does the stats.txt need to be placed in?
Could you define how this works; that is what are the rules for locating a file?

Thanks in Advance.
 
Tim Holloway
Bartender
Posts: 18465
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mobile devices are not PCs, so they're not obligated to have file systems. Often they do, but there's no standard and there may not be support for directories.

In the case of your example, the "/" means at the root of the file system (or at least Java's view of it), which would generally work even if there is no directory support.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!