stat() and the start of chmod()

This commit is contained in:
Lisa Milne 2023-11-13 09:54:23 +10:00
parent 781b9d1acc
commit 65da9d8682

View file

@ -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 = {