[Advanced-java] Portable path delimiters

HUBBARD,ERIC (HP-Roseville,ex1) eric.hubbard at hp.com
Thu Jul 3 17:15:42 2003


They also exist as static methods on File

-----Original Message-----
From: David Rosenstrauch [mailto:david.rosenstrauch@aleri.com]
Sent: Wednesday, July 02, 2003 12:54 PM
To: Advanced-java@lists.xcf.berkeley.edu
Subject: Re: [Advanced-java] Portable path delimiters


Use 

System.getProperty("file.separator")

and

System.getProperty("path.separator")


For more info, see:  
http://java.sun.com/j2se/1.4.1/docs/api/java/lang/System.html#getProperties(
)


DR


On Wednesday 02 July 2003 05:58 pm, peter robinson wrote:
> Hi all,
>
> can anyone tell me the best way to create OS-independent path delimiters
> while creating files within a new directory within a java application.
> Although everything works well with *nix slashes on windows by hardcoding
> them, I wonder if there is a better way?
>
> Thanx
>
> Peter

_______________________________________________
Advanced-java mailing list
Advanced-java@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/advanced-java