Fixed issue 6770 - write method do not truncate the file content