File Streams Syntax

Syntax: void open(char *filename, int open_mode, int access)

where:filename is the name of the file
open_mode determines why the file is opened. The open_mode must be one of the following:
open_modeMeaning
ios::appopen file for output and seek to the end of the file
ios::ateseek to the end of the file after opening it
ios::inopen file for input (default for ifstreams)
ios::nocreateif file does not exist, then fail the open
ios::noreplaceif file already exists, then fail the open
ios::outopen file for output (default for ofstreams)
ios::truncif file exists, then truncate its contents. (default for ios::out)

access determines how the file can be accessed. It must be one of the following:
AttributesMeaning
0normal file - open access
1read-only file
2hidden file
4system file
8archive bit set



Back to Previous Page

Document:
Local Date:
Last Modified On: