how can I make a TGA file from a frame buffer?

I have just

I have a textured scene and I read the frame buffer using:
glReadPixels (0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, Buffer);

Then I have to write them in a TGA format file, because this kind of files support the alpha chanel. How can I construct a good TGA format file? I don’t know how a TGA header is.

Have you searched the web? maybe

everthing you ever wanted to know about file formats, including tga (;