• If you need help or want to discuss things, you now can also join us on our Discord Server!

EN what's wrong with my fs.writeFile

Kuchi

Active Member
I'm trying to read and write to a text file and the read is working but the write not working
please help the stupid guy here :\
file CHMOD is 777 (for testing)
I have the last version : 1.0.0-beta.10-202ee4d

read is working
fs.readFile('/opt/sinusbot/data/output.txt');

write is not working
fs.writeFile('/opt/sinusbot/data/output.txt', 'try to write this text', 0777); fs.writeFile('/opt/sinusbot/data/output.txt', 'try to write this text');

error

error on callback func: Uncaught exception: Error: unexpected parameter type at testbot:568:3 fs.writeFile("/opt/sinusbot/data/output.txt", "try to write this text", 0777); ^ Stack trace: Error: unexpected parameter type at testbot:568:4

[Edit]
I'm so stupid !
I didn't use the bytesFromString() ...


thanks for the help guys
 
Last edited:

mikemiles

Member
Your code should look better. This technology platform allows creating software development solutions for internet application development, client-side technologies for web services, server-side technologies for client-server apps, and mobile services for mobile devices. I advise mlsdev.com/services/web-development
 
Last edited:
Top