Espacios de nombres
Variantes
Acciones

std::basic_fstream::open

De cppreference.com
< cpp‎ | io‎ | basic fstream
 
 
Biblioteca de E/S
Manipuladores de E/S
E/S estilo C
Búferes
(en desuso en C++98)
Flujos
Abstracciones
E/S de archivos
E/S de cadenas
E/S de arrays
(en desuso en C++98)
(en desuso en C++98)
(en desuso en C++98)
Salida sincronizada
Tipos
Interfaz de categoría de error
(C++11)
 
std::basic_fstream
Las funciones miembro
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Las operaciones de archivo
Original:
File operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_fstream::open
Terceros funciones
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
void open( const char *filename,
           ios_base::openmode mode = ios_base::in|ios_base::out );
void open( const std::string &filename,                                  
           ios_base::openmode mode = ios_base::in|ios_base::out );
(desde C++11)
Abre el archivo y asociados con la secuencia de archivo. Llamadas clear() en el éxito o en el fracaso setstate(failbit) .
Original:
Opens and associates file with the file stream. Calls clear() on success or setstate(failbit) on failure.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
La primera versión eficazmente llama rdbuf()->open(filename, mode).
Original:
The first version effectively calls rdbuf()->open(filename, mode).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
La segunda versión eficazmente llama open(filename.c_str(), mode) .
Original:
The second version effectively calls open(filename.c_str(), mode).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Contenido

[editar] Parámetros

filename -
el nombre del archivo que se abrirá
Original:
the name of the file to be opened
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mode -
especifica el modo de transmisión abierta. Es el tipo de máscara de bits, las siguientes constantes son definidas:
Constante Explicación
app Busca hasta al final del flujo antes de cada escritura.
binary Abrir en modo binario.
in Abrir para lectura.
out Abrir para escritura.
trunc Descartar el contenido del flujo al abrir.
ate Busca hasta al final del flujo inmediatamente después de abrirlo.
noreplace (C++23) Abrir en modo exclusivo.
Original:
specifies stream open mode. It is bitmask type, the following constants are defined:
Constante Explicación
app Busca hasta al final del flujo antes de cada escritura.
binary Abrir en modo binario.
in Abrir para lectura.
out Abrir para escritura.
trunc Descartar el contenido del flujo al abrir.
ate Busca hasta al final del flujo inmediatamente después de abrirlo.
noreplace (C++23) Abrir en modo exclusivo.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

(Ninguno)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ejemplo

[editar] Ver también

Comprueba si el flujo tiene un archivo asociado
Original:
checks if the stream has an associated file
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública) [editar]
cierra el archivo asociado
Original:
closes the associated file
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública) [editar]