File I/O with Mac OS X

Discussion in 'Java' started by Leonard Slatkin, Dec 10, 2003.

  1. 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")?
    Leonard Slatkin, Dec 10, 2003
    #1
    1. Advertising

  2. "Leonard Slatkin" <> wrote in message
    news:091220032329334796%...
    > 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..

    --
    Andrew Thompson
    * http://www.PhySci.org/ PhySci software suite
    * http://www.1point1C.org/ 1.1C - Superluminal!
    * http://www.AThompson.info/andrew/ personal site
    Andrew Thompson, Dec 10, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jake
    Replies:
    0
    Views:
    338
  2. Roman =?ISO-8859-15?Q?Bl=F6th?=

    Senseless rendering: Mac.Mozilla != Mac.Netscape6.01 ?!?!

    Roman =?ISO-8859-15?Q?Bl=F6th?=, Jul 2, 2003, in forum: HTML
    Replies:
    1
    Views:
    989
    Steve Pugh
    Jul 2, 2003
  3. mangm
    Replies:
    2
    Views:
    733
    mangm
    Dec 1, 2005
  4. K Richard Pixley
    Replies:
    3
    Views:
    335
    Ned Deily
    Jan 3, 2012
  5. Ronald Fischer

    On Mac: File.file? behaves strangely

    Ronald Fischer, Jan 1, 2011, in forum: Ruby
    Replies:
    2
    Views:
    81
    Ronald Fischer
    Jan 2, 2011
Loading...

Share This Page