Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>filebuf::open</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
filebuf::open

Usage

   #include <fstream.hpp>
   filebuf *filebuf::open(const char *name, int io_mode,
                       int protection = openprot);

Description

   Opens file name, in mode io_mode, with protection defaulted to openprot
   (0644), and attaches it to the filebuf. The io_mode argument should be a
   bit-mask containing one or more of the values from enum open_mode:

   ios::in          Open for reading.

   ios::out         Open for writing.

   ios::ate         Position to the end-of-file.

   ios::app         Open the file in append mode.

   ios::trunc       Truncate the file on open.

   ios::nocreate    Do not attempt to create the file if it does not exist.

   ios::noreplace   Cause the open to fail if the file exists. Open will
                    fail if the filebuf is already attached - it should be
                    closed first in that case.

Example 

   filebuf fb;
   fb.open("thing.dat", ios::out|ios::app);

Return Value

   Pointer to the filebuf object for which it was called, or zero on error.





Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson