TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: STEVEN READ
from: HERBERT BUSHONG
date: 1997-08-11 08:33:00
subject: Fstream identifying mode

::> HB> Is there a way to identify the mode that an fstream was opened in?
::> HB> (binary vs. text -- borland 4.5)
::> From TC 3.0 online help
::>    stat                           
::>  A structure containing information about a file or directory. Used by
::> the fstat and stat functions.
::> I'm not certain if this is it.  But it looks good.  :-)
That's not it. That's for information about a file/directory, not the mode 
that it was opened in...
ofstream of("SOMEFILE.BIN", ios::out | ios::binary):
  /* how do I check if file was opened with ios::binary? */
I overload the << operator for a class. Depending on whether it's opened in
binary mode or not, I either want to write the data out in binary format or
as text readable (if it's going to the display). 
#  Herbert Bushong    harchon@centuryinter.net       [TEAM OS/2]    
-  Blackbeard's BBS   Intelec: 239:600/0            
+  Fido: 1:19/19      http://www.intelec.com/software/
---
   RM 1.31 2508   Before we get married,I'd like you to sign 1 little thing
---------------
* Origin: Blackbeard's BBS - Ville Platte, LA - 318-468-3385 (1:19/19)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.