Cffile/ fileObj producing extra line feed/carriage return

Anyone know how to prevent fileWriteLine from producing an extra line feed the bottom of file?

When I run this

 myfile = "/testme.txt";
 mystr="hello world";
 fileObj = FileOpen( myFile, "write");
 fileWriteLine(fileObj,mystr );

I get :

hello world

FileWriteLIne() always adds a new line character ready for the the next line to be written. But you could get rid of the trailing line by adding the following to your script:

fileContents = FileRead( myfile );
FileWrite( myfile, fileContents.RTrim() );

cool that is really helpful. Thank you.