473,395 Members | 1,464 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.

iostream openmode flag

Hi,

How to check if the stream is opened in binary mode? Suppose, we are about
creating "bool is_binary(iostream &)" function for such an assertion, working
like this:
....
ofstream os ("test.dat", ios::binary);
if (is_binary(os)) cout << "The type is: binary." << endl;
....
How "is_binary" function should examine the stream to accomplish this?
Does "iostream" class store this information somewhere and how to access
this flag?

Thanks (a lot)!
Nov 17 '05 #1
0 1013

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

Similar topics

1
by: Marc Schellens | last post by:
When I do: static const ios_base::openmode emptyMode = ( ~(ios_base::app| ios_base::ate| ios_base::binary| ios_base::in| ios_base::out| ios_base::trunc));
42
by: Shayan | last post by:
Is there a boolean flag that can be set atomically without needing to wrap it in a mutex? This flag will be checked constantly by multiple threads so I don't really want to deal with the overhead...
7
by: S. Nurbe | last post by:
Hi, probably this is a common problem but I couldn't find yet a proper solution (and I hope there is one). I have two relative complex frameworks: one uses only iostream.h the other one only...
0
by: Garrett Kajmowicz | last post by:
I have two implementations of stringstream and they both handle interleaved reads and writes differently. I was hoping that you might be able to shed some light as to the "correct" operation, and...
3
by: Jim Archer | last post by:
Hi All... I'm been fighting this problem for a few days now, and it seems like it should be simple. But the solution has eluded me so far... I need to flag a record when it is updated or when...
2
by: Bernd Hohmann | last post by:
I need a control break flag in my result when a certain value is different to the previous. A table/result like this: PRODUCER ARTICLE 80000 1 <- flag = 1 80000 2 <- flag = 0 80000 ...
4
by: Noah Roberts | last post by:
I am writing a class that uses a passed in stream. The writing this class performs is binary and so I would like to assert that the stream is a binary stream. Problem is that I can't find any...
3
by: Nate | last post by:
This has probably already been addressed (but I can't find a reference to it in the groups). Tracking down a bug, I found that the OpenMode Enumeration in both the local and on-line MSDN is...
2
by: Efi Merdler | last post by:
Hello, As I understand it is impossible in xslt to change the value of a variable after you assigned a value to it. I would like to simulate a flag. For example if something happens in template...
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...
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
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...
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.