How do I handle paths for Windows, Linux and MacOs? (nwjs)

Get help using Construct 2

Post » Fri Jul 08, 2016 6:29 pm

So I already built my app that works on windows, and currently trying to make it work on Linux and Mac

I use paths a lot to read and write files locally, and been using backward slash "\" for windows paths

And trying it on Linux it would not find files, or just write the path in the filename like "directory\filename.jpg"

Now I read Windows seems to accept forward slash "sometimes", so should I use "/" everywhere?

Anyway what's best practice to treat paths for use on all systems?
B
22
S
6
G
8
Posts: 328
Reputation: 6,651

Post » Sun Jul 31, 2016 1:20 pm

So I had some time to try that in more details this week end

Forward slash seems to work most times for win/linux, except one case where I had to add "file://" beforehand

Still can't seem to make all work, anyone managed to use nwjs "run file" in Linux, for like, playing a video file and its default player for ex?
B
22
S
6
G
8
Posts: 328
Reputation: 6,651


Return to How do I....?

Who is online

Users browsing this forum: Blendi1223, kellehk, TRMG and 29 guests