0 Favourites

How do I read external file (txt, png, ogg) in linux (nw.js)

  • Hi,

    I'm near to finish my game, it works perfectly in win7.

    I installed virtualbox with Ubuntu to test it in linux. I've got the game work, but there is no way to load the savegame, play music, ... read any external file.

    -I can create files, the savegame work.

    -I use: NWjs.AppFolder & "save/slot1.sav" (it works in windows)

    -"NWjs path exists" detect the file.

    -The files have the read permission.

    Here's a sample source code:

    And exported to linux64 example:

    (With the "save" folder and 3 sample files)

    (You need "chmod a+x nw" to execute)

    I'm total noob in linux, there is something I must know about how to read files?

    Thank you

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I install mac OS X 10.11 in virtualbox and I have the same problem. I can't read external files. It only work in windows.

    The only way I have managed to open a file is through:

    NWjs.ReadFile( NWjs.AppFolder & "a.txt" )

    I can change all AJAX functions to use this... But I already can't load images or music.

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