473,406 Members | 2,849 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,406 software developers and data experts.

Methods for fast binary file output?

Hello,

I am a C/C++ newbie and I have a simple question concerning fast data
writing to binary files. Are there any other faster methods than the
standard write() method to write to binary data files? I ask this
question because I have to store a big amount of data coming from an
PCI A/D card with a sampling frequency of 20 MB/s. Now I have to
implement some additional computations and would need to speed up the
data transfer. I am using a Windows XP computer and GCC 3.4.3 and
Borland 5.5 respectively. Are there any special free libraries for
this purpose?

Thank you very much

Daniel

Jul 19 '07 #1
2 3610
<em****************@gmail.comwrote in message
news:11*********************@j4g2000prf.googlegrou ps.com...
Hello,

I am a C/C++ newbie and I have a simple question concerning fast data
writing to binary files. Are there any other faster methods than the
standard write() method to write to binary data files? I ask this
question because I have to store a big amount of data coming from an
PCI A/D card with a sampling frequency of 20 MB/s. Now I have to
implement some additional computations and would need to speed up the
data transfer. I am using a Windows XP computer and GCC 3.4.3 and
Borland 5.5 respectively. Are there any special free libraries for
this purpose?

Thank you very much
Well, the delay will come in to the physcial read and writes with moving the
heads, etc... If you buffer the writes then you shouldnt' get that delay.
This will especially work if you can load the entire data to write in
memory, although it doesn't sound like you can do that with 20MB/second.

Another alternative is to use threads. Send a write request to a thread
safe que that another thread reads to write the data, then your main thread
shouldn't have to wait for the file i/o to complete. This will probably work
as long as the writing thread can keep up with writing 20MB/second. I
really don't know how fast HDs are nowadays with MB/second but 20 should be
fine.

You might want to discuss this in comp.programming.threads
Jul 19 '07 #2
On Thu, 19 Jul 2007 07:45:29 -0700, email.ttindustries wrote:
Hello,

I am a C/C++ newbie and I have a simple question concerning fast data
writing to binary files. Are there any other faster methods than the
standard write() method to write to binary data files? I ask this
question because I have to store a big amount of data coming from an PCI
A/D card with a sampling frequency of 20 MB/s. Now I have to implement
some additional computations and would need to speed up the data
transfer. I am using a Windows XP computer and GCC 3.4.3 and Borland 5.5
respectively. Are there any special free libraries for this purpose?
Do you REALLY need to sample at 20MB/s? Can you lower the sampling rate
to something realistic and still get adequate samples? That would be my
first question.

Jul 23 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tron Thomas | last post by:
What does binary mode for an ofstream object do anyway? Despite which mode the stream uses, operator << writes numeric value as their ASCII representation. I read on the Internet that it is...
103
by: Steven T. Hatton | last post by:
§27.4.2.1.4 Type ios_base::openmode Says this about the std::ios::binary openmode flag: *binary*: perform input and output in binary mode (as opposed to text mode) And that is basically _all_ it...
8
by: Yeow | last post by:
hello, i was trying to use the fread function on SunOS and ran into some trouble. i made a simple test as follows: i'm trying to read in a binary file (generated from a fortran code) that...
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
4
by: David Buchan | last post by:
Hello, I wonder if anyone could help me. I'm using vb.NET and I'd like to read a binary file, byte by byte, and then write to another file (making a duplicate, identical file). I'd then...
12
by: Adam J. Schaff | last post by:
I am writing a quick program to edit a binary file that contains file paths (amongst other things). If I look at the files in notepad, they look like: ...
2
by: Madhusudhanan Chandrasekaran | last post by:
Hi: This question is not directed "entirely" at python only. But since I want to know how to do it in python, I am posting here. I am constructing a huge matrix (m x n), whose columns n are...
5
by: Chad Miller | last post by:
Public mLength As Integer Public mChannels As Short Public mSampleRate As Integer Public mDataLength As Integer Public mBitsPerSample As Short Public Sub CreateWaveHeader(ByRef sPath As...
3
by: email.ttindustries | last post by:
Hello, I am a C/C++ newbie and I have a simple question concerning fast data writing to binary files. Are there any other faster methods than the standard write() method to write to binary data...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.