I opened a (text) file, like so: File *fp = fopen("findPattern2.txt", "w+"); in which i have written text. The last character i have in there is a ,. Now i want to delete that character using backspace. I've read the answers here that BACKSPACE only moves the cursor, then i have to overwrite that character by writing on top of it and this is what i do. So I did fprintf(fp, "\b \b") to completely erase the ,, but instead this is what the file shows afterwards:,BS BS. All of these work with a terminal. Why not with a file?
From what I gather the only way to do this to a file would be if i memory mapped it, edit its contents, copy them to a new file and delete the old one.
 
     
     
     
    