diff --git a/lib/file.js b/lib/file.js index 55611bd..3a58d1a 100644 --- a/lib/file.js +++ b/lib/file.js @@ -7,7 +7,7 @@ // ///////////////////////////////////////////////////////////////////////////////// -var LIB = require('lib/std'); +var LIB = require("lib/std"); ///////////////////////////////////////////////////////////////////////////////// // readFile @@ -184,6 +184,31 @@ var FileObject = function() { return writeFile(this.filename, content, this.charset); } }; + + this.chown = function(username) { + if (this.isFile) { + //require("lib/shell").run(["cacls", this.filename, "/G", user + ":F"]); + require("lib/shell").run([ + "icacls", + "/C", + "/q", + this.filename, + "/grant", + username + ":(F)" + ]); + } else if (this.isDirectory) { + //require("lib/shell").run(["cacls", this.filename, "/G", user + ":F"]); + require("lib/shell").run([ + "icacls", + "/C", + "/t", + "/q", + this.filename, + "/grant", + username + ":(F)" + ]); + } + }; this.mkdir = function() { return this.interface.CreateFolder(this.filename);