Todo.txt-Enyo/srv/WriteFileAssistant.js

11 lines
339 B
JavaScript
Raw Normal View History

2012-03-06 19:32:49 +00:00
var WriteFileAssistant = function() {
}
WriteFileAssistant.prototype.run = function(future) {
var fs = IMPORTS.require("fs");
var path = this.controller.args.path
var content = this.controller.args.content
fs.writeFile(path, content, 'utf8', function(err) { future.result = { path: path, bytes: content.length, error: err }; });
}