temp file for intermediate storing before writing the new file

Scott Wheeler wheeler at kde.org
Sun Jan 29 15:06:04 CET 2006


On Sunday 29 January 2006 14:57, Jochen Issing wrote:
> Hi All,
>
> regarding iTunes Tags I would like to ask for your opinion. I need to write
> the new file into a new location before being able to write the whole file
> at once. Therefore, I thought about writing a temp file, which will be
> copied to the new location afterwards and reopened.
>
> Is there already something like that in taglib? If not, is the temp file
> the correct solution? Can I use the function tempnam() from <stdio.h>?

id3lib did something like that and it was a source of all kinds of problems 
(many of which I fixed back when I was working on it).  TagLib provides 
functions in the TagLib::File API to do insertion and replacement directly 
into files that will handle moving back the contents of the file.

If those functions don't provide what you need if you could describe what it 
is that you need in more detail I could probably write functions to handle 
your requirements without a temp file.

Cheers,

-Scott

-- 
The three chief virtues of a programmer are: laziness, impatience and hubris.
--Larry Wall


More information about the taglib-devel mailing list