Answer the question
In order to leave comments, you need to log in
A few questions about DIRECTORY_SEPARATOR?
Hello!
I wrote a web application. And instead of DIRECTORY_SEPARATOR, I used /
. Why does it work on Windows? After all, in Windows you need to use \
. Works great on Linux. I heard that nixes work with forward slashes too /
. Why then is this constant needed?
And another question. Why should we use it in the back-end. And in the front-end'e - no? I have never seen a file connected through some DIRECTORY_SEPARATOR. Usually just like this:
<link rel="stylesheet" href="/assets/css/main.css" type="text/css">
Answer the question
In order to leave comments, you need to log in
The urls use only a regular slash, so there are no problems at the front.
On the back, the slash used in the path depends on the axis. I had problems with it, but in the furry years. Now it seems like it’s already normal, but somehow I don’t want to experiment.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question