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

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)