Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Windows file paths

807569Sep 11 2006 — edited Sep 11 2006
Hi All,
As I have tried a few times, the windows file path separator (\) character is not directly compatible with the way java works.
So if I have to create

File file = new File("C:\temp");
the file won't work, I need to append the escape sequence \ also like,

File file = new File("C:\\temp");

What I wanted to know is there any java utility classes provided by JDK to convert this kind of file path to directly File objects?

Please suggest.
Regards
Ayusman
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2006
Added on Sep 11 2006
3 comments
387 views