473,769 Members | 5,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3642
<em************ ****@gmail.comw rote in message
news:11******** *************@j 4g2000prf.googl egroups.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.programmin g.threads
Jul 19 '07 #2
On Thu, 19 Jul 2007 07:45:29 -0700, email.ttindustr ies 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
3496
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 possible to change the behavior of operator << so it will stream numeric values as their actual values when an ofstream is in binary mode. I did not, however, find any information on how this can be accomplished. What is involved in getting this...
103
48753
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 says about it. What the heck does the binary flag mean? -- If our hypothesis is about anything and not about some one or more particular things, then our deductions constitute mathematics. Thus mathematics may be defined as the subject in...
8
9532
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 contains the following three floating-point numbers: 1.0 2.0 3.0
29
3679
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 id="Form1" method="post" runat="server"> <%
4
17134
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 like to modify the program to take the integer value of each byte and say, add or subtract an integer from it, with the result still being an integer from 0 to 255. Then write another file that is
12
5927
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: <gibberish>file//g:\pathtofile1<gibberish>file//g:\pathtofile2<gibberish> etc. I want to remove the "g:\" from the file paths. I wrote a console app that successfully reads the file and writes a duplicate of it, but fails for some reason to do the "replacing" of the "g:\". The code...
2
1553
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 stored in smaller files. Once I read m such files, my matrix is complete. I want to pass this matrix as an input to another script of mine (I just have the binary.) Currently, the script reads a file (which is nothing but the
5
1551
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 String) Dim fileNumber As Integer Try
3
569
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 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...
0
10045
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7408
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.