I have a file opened in 'ab+' mode.
What I need to do is replacing some bytes in the file with another string's bytes such that:
FILE:
thisissomethingasperfectlygood.
string:
01234
So, for example, I seek for the position (4, 0) and I want to write 01234 in the place of "issom" in the file. Last appearance would be:
this01234ethingasperfectlygood
.
There are some solutions on the net, but all of them (at least what I could find) are based on "first find a string in the file and then replace it with another one". Because my case is based on seeking, so I am confused about the solution.