In PHP, to ensure that a path contains OS-appropriate directory separator characters, one would use the DIRECTORY_SEPARATOR constant (although it might not always be necessary to do so).
Is there an equivalent entity in Java?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are two system-dependant constants provided by the
java.io.Fileclass:java.io.File.separatoris a string containing the system-dependent name-separator character (ie “/” for Unix, “\” for Windows)java.io.File.pathSeparatoris a string containing the system-dependent path-separator character (ie “:” for Unix, “;” for Windows)