class ID3 {
inherit ADT.Struct;
Item head = Chars(3);
Item title = Chars(30);
Item artist = Chars(30);
Item album = Chars(30);
Item year = Chars(4);
Item comment = Chars(30);
Item genre = Byte();
}
Stdio.File f = Stdio.File("foo.mp3");
f->seek(-128);
ADT.Struct tag = ID3(f);
if(tag->head=="TAG") {
write("Title: %s\n", tag->title);
tag->title = "A new title" + "\0"*19;
f->seek(-128);
f->write( (string)tag );
}