how to write data from buffer to multiple files in loop using file stream

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • veerendra
    New Member
    • Jul 2017
    • 1

    #1

    how to write data from buffer to multiple files in loop using file stream

    I'm able to write the data from buffer to one single file continuously .But i want write the data into multiple files sequentially one after the other after reaching some stream length and also after some file no. equal to 10 again it should write to first file and so on .what i tried is given below .i hope you people will help me to sort out of this problem.
    while (true)
    {
    int filenumber = 0;
    const int sizeLimitInByte s = 360960 * 16;
    using (var fs = new FileStream("C:\ \user\\mady\\de sktop\\filenum. txt", FileMode.Create , FileAccess.Read Write))
    {
    while (true)
    {
    fs.Write(xBufs[k], 0, xBufs[k].Length);
    index++;
    Offset += len;
    EndPoint.BeginD ataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k]);

    if (fs.Length >= sizeLimitInByte s)
    {

    }
    }
    }
    }
    Last edited by veerendra; Jul 15 '17, 10:23 AM. Reason: i left one point in discription
Working...