I am trying to find a location for the save files of my game. I am trying to use NW.js to export. The manual recommends using NWjs.UserFolder for permissions reasons. I would like to be able to get to the documents folder from there and create a folder inside for my game's files.
Firstly as I understand, with different versions of Windows, the documents folder changes name, "./documents", "./My Documents" etc. How can I combat this? The only system information I can find is from the browser object and it returns Win32 for any windows OS, so it doesn't really help.
For Mac and Linux I simply don't know what the file system appears, so I need pointers on those two.
Finally: I run Windows 7 on a machine with two hard drives. All of my documents, pictures, music etc. is on drive E, whereas all my programs and that sort of data are on drive C with the os. Even knowing the name of my documents folder does not help. Using NWjs.UserFolder I can manipulate the directory "C:\Users\Briggybros" However, my documents folder is located at "E:\Users\Briggybros\documents". It is registered with Windows that this is my documents folder and I can access it as normal. However, using [NWjs.UserFolder & "\documents"] gives an empty directory as it is not there without the use of Windows' referencing. Can this be tackled at all?