add new test for readonly
bugfix: overwrite file if readonly (to support tfs properly)