allows to write at the end or at the beginning of a file