title: String replacing in a file by given position
body: <p>I have a file opened in 'ab+' mode.</p>
  
  <p>What I need to do is replacing some bytes in the file with another string's bytes such that:</p>
  
  <p>FILE:</p>
  
  <pre><code>thisissomethingasperfectlygood.
  </code></pre>
  
  <p>string:</p>
  
  <pre><code>01234
  </code></pre>
  
  <p>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:</p>
  
  <p><code>this01234ethingasperfectlygood</code>.</p>
  
  <p>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.</p>