Open Choko256 opened 3 years ago
@Choko256 ah! Great observation. Making sure cross-everything compatibility/environment is supported is extremely important to me, tho this particular fix is not on an urgent horizon and this is pretty standard NodeJS filesystem stuff, would you be willing to PR the fix?
Offending line is https://github.com/amark/gun/blob/master/lib/rfs.js#L44 I think? (hmm, tho maybe its actually also a bug in the stats code?)
Crash course: Seems you already figured out GUN is in-memory and relies on storage adapters, of which RAD was made default with radisk and the fs
plugin to it called lib/rfs.js
which is a tiny < 100 file which should fix this for all local filesystem usages (such as Electron, etc.). So this should be a safe easy spot to PR I hope!
Sorry for the delay, been catching up from big legal thing early last week.
In the Gun constructor on NodeJS, specify an absolute path in the file parameter will result in a stats file creation error.
In my example, I'm building an Electron app with Gun, and specifying something like :
The specified folder will successfully be created by Radisk, the structure is there, but every second a big error is logged in the console :
Why would I want an absolute path ? On MacOS, applications are embedded within a
.app
file. The contents inside these files are read-only, so when Radisk tries to create the folder relative to the process, it's failing.