Question about filesystem path parameters

In a gdevelop filesystem event, if I enter the path
the actual js code that gdevelop will generate will have “C:/example/example.example”, which is whats supposed to happen
however if instead of using a forward slash I use a backslash then weird things happen,
In a filesystem event’s path parameter I enter the path
the actual javascript code that gdevelop will generate will have “C:\e\x\a\m\p\l\e\example.example”
So anything in between two backslashes will have each letter seperated by a backslash for some reason, which is kinda odd, I have no idea why this happens.

Below are screenshots of what happens, I use the path “C:\example\example.example” which is not a valid path, but I open the inspect tool when running a preview of my game to see what the path turns into in the error message, since they’ll be an error in the inspect tool’s console cause the path is invalid.

I type “C:/example/example.example” with forward slashes

I look at the invalid path error message in the inspector tool, it says I typed “C:/example/example.example” which is correct, I did type that, good job gdevelop,

But now I type “C:\example\example.example” with backslashes

But in the inspect tool’s error message it says I typed “C:\e\x\a\m\p\l\e\example.example” even though I didn’t type backslashes in between the letters of the word “example”, why?

The solution is obously to just use forwardslashes instead of backslashes, I’m not sad or angry that this happens, I’m just confused why this happens, its not really annoying or a really bad thing, its just kinda weird, lol

Not a bug, it’s been this way for decades (in computing in general, not GDevelop).

A backslash in Windows path represents a separation between folders. However, everywhere else a backslash is commonly used to escape a character. So for example \t can be used for tab, \n is newline etc. For a bit more, see “Escape Character” in this link

So everywhere else, which includes JavaScript, a forward slash separates folders in a path.

And a bit of background - Why Windows and Javascript use different slashes to separate folders in a path.

1 Like

MrMen is correct. You shouldn’t/can’t use manually typed path. The filesystem expressions are required, especially the path delimiter expression.

Oh, I had thought there was some explanation that I’m too dumb to know, thanks for the info! I am very dumb, have a good day!