MZ What is wrong with this plugin that makes it not work in MZ?

In MV, I used a plugin called ozu_file (https://raw.githubusercontent.com/ozubon/tidbits/master/ozu_File.js). Now after converting to MZ, I tried to see if I was lucky enough to have it work without modifications. Unfortunately, attempting to write files comes with this error

1720311754335.png


This is the command I'm using

1720311777788.png


The script isn't too long, so I'm sure its possible for me to modify it to function in MZ. Anyone have any advice as to what pieces need to change to make it work in MZ?
MZ uses a newer version of nw.js than MV
How would I go about "updating" this script to the new NW.js?
MZ uses a newer version of nw.js than MV
That's true - so how is fs.writeFileSync() different in this newer version?

@Benja Have you checked that your project directory/the data folder isn't flagged read-only or anything basic like that?
It is checked as read only, but in Windows 10 all folders revert to read only. My MV version of the project is also checked as read only, but it is capable of creating files, unlike MZ so far.
Hm. I don't see why this would make a difference between versions or projects, but try editing line 169 of the plugin to say "./" rather than "/"

This plugin is really weirdly written, the author uses some very bizarre syntax.
The ./ change seems to have fixed it! Thank you very much!
Is there any way to use this plugin to make a file on the desktop? I'm creating a meta-horror game which involves interacting with files and 4th wall breaking , so I want to make a contained folder for all those files it makes to go
Then you need to check node.js document.
It is something like:
os = require('os');
path = require('path');
var home = os.homedir();
var desktop = path.join(home, 'Desktop/');

Edit*
Assuming you are using windows.
Just to offer the feedback, I would be pretty upset if I was playing a video game and it took the liberties of doing anything on my computer outside of the expected areas (e.g. its own installation and save directories).

My desktop is for my files, not for someone else to play around with.

Original thread: https://forums.rpgmakerweb.com/threads/what-is-wrong-with-this-plugin-that-makes-it-not-work-in-mz.170092/