unit test 1 chnages 1)when opening in wr,app mode, made mode as r+b 2)changes for error logic in append and write 3)changes for reopen in write and append 4) test code