function to write text to files.

Now we need to change the call to this function so we'll be able to know
witch process created the compressed partial file