TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JERRY COFFIN
from: HERBERT BUSHONG
date: 1997-08-13 09:17: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)
::> None of which I'm aware, but fortunately, it shouldn't be terribly
::> difficult to add the capability yourself:
::> class my_stream : public fstream {
::>     int mode_;
I don't know if there's a way to use it, but the filebuf class already has a
mode member (protected:) which stores this information. Still, deriving a
new class similar to the above seems a safer/easier way to capture the 
parameter...
::> You may have to add a few more things to this; for example, I believe
::> Borland supports a third parameter that determines the sharing allowed
::> with the file, and you may want to support that as well.  Likewise, you
Yeah, it has an optional 3rd protmode parameter, which I've never used :)
Thanks,
#  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   Is a castrated pig disgruntled?
---------------
* 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™.