If you mean, you want to write to random positions of the file, then I think you can make a func like this :

Code: c
void SeekTo_NthBlock(FILE *pFile, int n, int blocksize)
{
      // Note that this func treats the first block as Block 0, second as Block 1 and so on ..

      fseek(pFile, 0, SEEK_SET);
      for(int i = 0; i < n; ++i)
            fseek(pFile, blocksize, SEEK_CUR);
}

After defining the above func, you can use it like this :
Code: C
// Write to 100th block
SeekTo_NthBlock(fp, 99, 102400);
fwrite(buf, 1, 102400, fp);

// Write to 10001st block
SeekTo_NthBlock(fp, 10000, 102400);
fwrite(buf, 1, 102400, fp);

Is that what you wanted ?