The Microsoft Input/Output Stream Classes (iostream.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
filebuf::open
filebuf                                     Up Contents Index Back
──The Microsoft iostream Classes────────────────────────────────────────────
 
  filebuf* open( const char* szName, int nMode,
                 int nProt = filebuf::openprot );
 
  Parameter   Description
 
  <szName>    The name of the file to be opened during construction.
 
  <nMode>     An integer containing mode bits defined as ios enumerators
              that can be combined with the OR (|) operator. See the
              ofstream constructor for a list of the enumerators.
 
  <nProt>     The file protection specification; defaults to the static
              integer filebuf::openprot that is equivalent to
              filebuf::sh_compat. The possible <nProt> values are as
              follows:
 
              Value                Meaning
 
              filebuf::sh_compat   Compatibility share mode.
 
              filebuf::sh_none     Exclusive mode──no sharing.
 
              filebuf::sh_read     Read sharing allowed.
 
              filebuf::sh_write    Write sharing allowed.
 
              The filebuf::sh_read and filebuf::sh_write modes can be
              combined with the logical OR (|) operator.
 
  Remarks
 
  Opens a disk file and attaches it with this filebuf object. If the file
  is already open, or if there is an error while opening the file, the
  function returns NULL; otherwise it returns the filebuf address.
 
  See Also
 
  filebuf::is_open, filebuf::close, filebuf::~filebuf
 
 
                                     -♦-