mirror of
https://codeberg.org/TicklishHoneyBee/CLIte.git
synced 2026-03-11 09:04:37 +00:00
stat() and the start of chmod()
This commit is contained in:
parent
781b9d1acc
commit
65da9d8682
1 changed files with 34 additions and 1 deletions
|
|
@ -656,6 +656,35 @@ clite.io = {
|
|||
return true;
|
||||
}
|
||||
return vfsapi.mkLink(path,target);
|
||||
},
|
||||
clite.io.fstat = function(fd) {
|
||||
if (!fd || !fd.node)
|
||||
return null;
|
||||
|
||||
var stat = Object.create({
|
||||
type:clite.lib.getFileType(fd),
|
||||
uid:fd.node.uid,
|
||||
gid:fd.node.gid,
|
||||
size:0,
|
||||
perms:fd.node.perms
|
||||
});
|
||||
|
||||
if (stat.type == 1 || stat.type == 7)
|
||||
stat.size = fd.node.data.content.length;
|
||||
|
||||
return stat;
|
||||
},
|
||||
clite.io.stat = function(path) {
|
||||
var fd = getFileDes(path,true,false);
|
||||
return clite.io.fstat(fd);
|
||||
},
|
||||
clite.io.fchmod = function(fd,mode) {
|
||||
// TODO: actual chmod
|
||||
return false;
|
||||
}
|
||||
clite.io.chmod = function(path,mode) {
|
||||
var fd = getFileDes(path,true,false);
|
||||
return clite.io.fchmod(fd,mode);
|
||||
}
|
||||
},
|
||||
creat:null,
|
||||
|
|
@ -669,7 +698,11 @@ clite.io = {
|
|||
truncate:null,
|
||||
seek:null,
|
||||
remove:null,
|
||||
link:null
|
||||
link:null,
|
||||
stat:null,
|
||||
fstat:null,
|
||||
chmod:null,
|
||||
fchmod:null
|
||||
};
|
||||
|
||||
clite.vfs = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue