File writing with string reversions