M
M
mrdragon90002019-10-24 20:57:01
macOS
mrdragon9000, 2019-10-24 20:57:01

Electron application cannot create or read any file on mac os, what should I do?

I built an application on electron-e. The application requires storage, so I just create a file next to the program via nodejs fs.writeFileSync function.
When I run the project with npm start, the file is created and everything works fine.
When I build the project through electron-builder (for mac os) - the application can no longer create the file. Error -13 EACCES - permission denied. What to do? If there are not enough rights, I will not know how to get them.
Maybe there are special storage directories in which the application should create its files?
Or what can you think of a replacement?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-10-25
@sxq

Creating any files inside the folder with the application is a bad idea, for temporary files there is a temporary folder where there are no access restrictions, for example, /
tmp
Mac OS is a regular Unix system.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question