Writing to text file avr mega168

OK, hopefully we can all use this new thread to learn how to write to a text file on an sd card with the mega168.

I have looked around and you need the fat.h file - fine

A project i have almost completed, with a lot of help from here, can read from the sd card - mp3 files. I dont believe it is as difficult as it is proving to write a few numbers into a text file on the sd card. Has anyone seen how this can be done with fat.h?

if someone knows the solution, please share it, because it is no where else on the internet. I’m sure i have looked everywhere.