What I really want to do is to delete one line from a file. My idea is to read all data before the line I want to delete and save it into a buffer. Then I read all data after the line I want to delete until the end of the file. Once I have saved all data, I try to delete the file but it fails. I want to delete the file just to create another one with the same filename and write the data I have saved into it. But everytime I try to delete the file it fails, and I don't know what to do. Could you help me? Thanks.