CreateBinaryFile

This commit is contained in:
copy 2015-01-16 10:12:58 +01:00
commit f85e33ae08

View file

@ -486,6 +486,16 @@ FS.prototype.CreateTextFile = function(filename, parentid, str) {
return id;
}
FS.prototype.CreateBinaryFile = function(filename, parentid, arraybuffer) {
var id = this.CreateFile(filename, parentid);
var x = this.inodes[id];
var data = this.inodedata[id] = new Uint8Array(arraybuffer.slice());
//x.waswritten = true;
x.size = arraybuffer.byteLength;
return id;
}
FS.prototype.OpenInode = function(id, mode) {
var inode = this.GetInode(id);
if ((inode.mode&S_IFMT) == S_IFDIR) {