Skip to content

Instantly share code, notes, and snippets.

View hankchanocd's full-sized avatar
😈
Mobilize the world with AI

Hank Chan hankchanocd

😈
Mobilize the world with AI
View GitHub Profile
@hankchanocd
hankchanocd / read-write-file.js
Created March 23, 2018 14:10
Read Write to file with javascript
/// write to file
var txtFile = "c:/test.txt";
var file = new File(txtFile);
var str = "My string of text";
file.open("w"); // open file with write access
file.writeln("First line of text");
file.writeln("Second line of text " + str);
file.write(str);
file.close();