File I/O with Mac OS X

L

Leonard Slatkin

This is my first attempt at file I/O, so if it sounds like I don't know
what I'm doing, I don't!

If I'm going to read a file (using a FileInputStream) from disk in Mac
OS X, how do I specify the path and directory? That is, where does it
start looking, (in Users\myusername ?), and how do I specify the
delimiters? (like "directory\\filename")?
 
A

Andrew Thompson

Leonard Slatkin said:
This is my first attempt at file I/O, so if it sounds like I don't know
what I'm doing, I don't!

If I'm going to read a file (using a FileInputStream) from disk in Mac
OS X, how do I specify the path and directory? That is, where does it
start looking, (in Users\myusername ?), and how do I specify the
delimiters? (like "directory\\filename")?

Try this..

File f = new File(".");
System.out.println( File.pathSeparator );
System.out.println( File.separator );
System.out.println( f.getCanonicalPath() );

That might get you started..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top