Add lseek to writeData()