This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Okteta structure tool. How to get file size?

Tags: None
(comma "," separated)
cadea
Registered Member
Posts
2
Karma
0
File has the following format:

1. fixed size header;
2. body; unknown size;
3. fixed size header.

Can I define these structure with Okteta?
How to determine the size of the file to calculate "body" size?

Here is prototype.

cat /home/user/.kde/share/apps/okteta/structures/test/main.js

function init () {

var header = struct( {
"header" : int32()
} );

var body = array( char(), 0 );
body.updateFunc = function ( main_struct ) {
// TODO: how to calculate size?
this.length = 2;
}

var footer = struct( {
"footer" : int32()
} );

var file = struct( {
"header" : header,
"body" : body,
"footer" : footer
} );

return file;
}

Note. Headers does not contain file size.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot]