Update file.js

This commit is contained in:
Namhyeon Go 2020-11-25 12:12:08 +09:00
parent d8297d77a5
commit 50c29aec32

View File

@ -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);