• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between '/' and '\' when useing file path names

 
Devasia Manuel
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Windows Vista, file names use the backslash('\') and when I try and set a file path name using File f=new File("C:\");, java thinks that I am using escape caracters. How can I solve this problem??
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65526
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use forward slashes. Or properly escape the back-slashes.
[ August 29, 2008: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!