File read/write

Develop and Deploy Native Apps for Windows, OS X, Linux, Unix ...

File read/write

Postby sedrok » Mon Jul 07, 2014 12:32 pm

As i understood Node.js can be used:

read:
javascript code
fs = require('fs');
fs.readFile('c:\\test.txt', 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
console.log(data);
});


write:
javascript code
var fs = require('fs');
fs.writeFile("c:\\test.txt", "Hey there!", function(err) {
if(err) {
console.log(err);
} else {
console.log("The file was saved!");
}
});
Attachments
5yj4g334f4.jpg
5yj4g334f4.jpg (159.76 KiB) Viewed 4169 times
sedrok
 
Posts: 26
Joined: Tue Jun 03, 2014 12:50 pm

Return to CrossUI for Desktop Apps

Who is online

Users browsing this forum: No registered users and 0 guests

cron