473,395 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 sizeLimitInBytes = 360960 * 16;
using (var fs = new FileStream("C:\\user\\mady\\desktop\\filenum.txt", FileMode.Create, FileAccess.ReadWrite))
{
while (true)
{
fs.Write(xBufs[k], 0, xBufs[k].Length);
index++;
Offset += len;
EndPoint.BeginDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k]);

if (fs.Length >= sizeLimitInBytes)
{

}
}
}
}
Jul 15 '17 #1
0 1266

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: googlinggoogler | last post by:
Hiya, The title says it all really, but im a newbie to python sort of. I can read in files and write files no probs. But what I want to do is read in a couple of files and output them to one...
4
by: Shrinivas | last post by:
Hi, Let us say my web.config is keep growing and I want to break the data logically and still use web.config methods to retrieve the data. e.g. <?xml version="1.0" encoding="utf-8" ?>...
5
by: JenHu | last post by:
Hi experts, I wrote a function which retrieves a file in the folder, the file path is : Dim sr As New StreamReader(strFilepath & ReturnFileName) What if I have more than 1 file_name in...
1
by: Anderson | last post by:
Dear all, Could anyone tell me how to convert binary data in buffer to string format,thanks in advance! Anderson
43
by: bonneylake | last post by:
Hey Everyone, Well this is my first time asking a question on here so please forgive me if i post my question in the wrong section. What i am trying to do is upload multiple files like gmail...
2
by: rka77 | last post by:
Hi, I am trying to make a Python2.6 script on a Win32 that will read all the text files stored in a directory and print only the lines containing actual data. A sample file - Set : 1 Date:...
6
by: shilpag | last post by:
How to export data to multiple excel worksheets using php can anyone help on this please
1
by: saurabh9gupta | last post by:
Hi. I have a code in which I have read the data from acess database into a datatable. I now have to write the data present in the datatable to an xml file. The data in the data table is...
9
by: Man4ish | last post by:
Hi, I am newbie to multi-threading. I am working on one pblm where i need to process 24 files (each size = 3 GB) and write the output onto multiple files(24). Each file takes around 1 hour to...
0
by: Man4ish | last post by:
Hi, I am working on one project on multi core (80 core) server. I have to write my results into multiple files (here 24 ) simultaneously. Which one will be better to use, MPI or pthread? ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.