temp file for intermediate storing before writing the new file

Scott Wheeler wheeler at kde.org
Sun Jan 29 15:36:43 CET 2006

On Sunday 29 January 2006 15:24, Jochen Issing wrote:
> That sounds quite well. I need to replace a certain part of the file - the
> moov-box, which contains all informational structures/tables/descriptions
> etc. And then append the other boxes. I will take a look at the functions
> and check them for my needs.

The key one is TagLib::File::insert()

Kind of a pseudo-code example would be:

bool SomeFileSubclass::save()
  insert(d->tag->render(), d->tagLocation, d->oldTagSize);
  return true;

One implementation note is that you want to avoid multiple calls to insert() 
if possible.  So it's best to render all of the data that you're going to 
need to for the tag, collect it in a ByteVector and then do one big 
insertion.  Insert actually writes to the file, so rewriting the file 
multiple times is not great.



The world is full of magical things patiently waiting for our wits to grow 
--Bertrand Russell

More information about the taglib-devel mailing list