mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-12 04:31:04 +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
|
// readFile
|
||||||
|
@ -185,6 +185,31 @@ var FileObject = function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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() {
|
this.mkdir = function() {
|
||||||
return this.interface.CreateFolder(this.filename);
|
return this.interface.CreateFolder(this.filename);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user