• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

File separator

 
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,
I want to know what differences between File.separator and File.pathSeparator ?
thanks
daniel
 
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Daniel
==============================================
1)c:\java\bin
here '\' is a separator
2)java -classpath c:\a.jar;b:\b.jar test.java
here ';' (between pathes) is a path separator.
==============================================
Additionally quote from Khalid Mughal's Chapter18


The pathname for a file or directory is specified using the naming conventions of the host system.However, the File class defines platform-dependent constants that can be used to handle file and directory names in a platform independent way:
public static final char separatorChar
public static final String separator
Defines the character or string that separates the directory and the file components in a pathname. This separator is '/', '\' or ':' for Unix,Windows and Macintosh, respectively.
public static final char pathSeparatorChar
public static final String pathSeparator
Defines the character or string that separates the file or directory names in a �path list�. This character is ':' or ';' for Unix and Windows, respectively.



Jamal Hasanov
www.j-think.com
 
Evacuate the building! Here, take this tiny ad with you:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic