mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-11 09:24:58 +00:00
Update file.js
This commit is contained in:
parent
d8297d77a5
commit
50c29aec32
27
lib/file.js
27
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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user