C-style file input/output
De cppreference.com
![]() |
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
El subconjunto CI / S del C + + biblioteca estándar C-estilo implementa flujo de entrada / salida de las operaciones. La cabecera
<cstdio>
proporciona apoyo genérico operación de archivo y las funciones de los suministros estrechos y con carácter multibyte de entrada / salida de capacidades, y la cabecera <cwchar>
proporciona funciones de entrada de caracteres de ancho / capacidades de salida . Original:
The C I/O subset of the C++ standard library implements C-style stream input/output operations. The
<cstdio>
header provides generic file operation support and supplies functions with narrow and multibyte character input/output capabilities, and the <cwchar>
header provides functions with wide character input/output capabilities. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Flujos de C son objetos de tipo std::FILE que sólo se puede acceder y manipular a través de punteros de tipo std::FILE* (Nota: aunque puede ser posible crear un objeto local de std::FILE tipo de eliminación de referencias y copiar un FILE* válido, utilizando la dirección de dicha copia en las funciones de E / S es un comportamiento no definido). Cada corriente de C está asociada con un dispositivo externo físico (archivo, secuencia de entrada estándar, una impresora, un puerto serie, etc) .
Original:
C streams are objects of type std::FILE that can only be accessed and manipulated through pointers of type std::FILE* (Note: while it may be possible to create a local object of type std::FILE by dereferencing and copying a valid FILE*, using the address of such copy in the I/O functions is undefined behavior). Each C stream is associated with an external physical device (file, standard input stream, printer, serial port, etc).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Corrientes de C se pueden utilizar tanto para la entrada sin formato y formateado y de salida. Son sensible a la localidad y pueden realizar todo / multibyte conversiones según sea necesario. A diferencia de C + + arroyos, donde se asocia cada corriente con local propio, todos los flujos de C acceso al objeto mismo lugar: la más reciente instalado con std::setlocale .
Original:
C streams can be used for both unformatted and formatted input and output. They are locale-sensitive and may perform wide/multibyte conversions as necessary. Unlike C++ streams, where each stream is associated with its own locale, all C streams access the same locale object: the one most recently installed with std::setlocale.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Además de la información específica del sistema necesario para acceder al dispositivo (por ejemplo, un descriptor de archivo POSIX), cada objeto de secuencia C contiene lo siguiente:
Original:
Besides the system-specific information necessary to access the device (e.g. a POSIX file descriptor), each C stream object holds the following:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
1)
Anchura de caracteres: estrecho o ancho
Original:
Character width: narrow or wide
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
2)
Buffering estado: sin búfer, la línea de búfer, con búfer completo .
Original:
Buffering state: unbuffered, line-buffered, fully buffered.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
3)
El tampón, el cual puede ser sustituido por un externo, proporcionado por el usuario tampón .
Original:
The buffer, which may be replaced by an external, user-provided buffer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
4)
Modo I / O: entrada, salida o actualización (tanto de entrada como de salida) .
Original:
I/O mode: input, output, or update (both input and output).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
5)
Binary / indicador de modo de texto .
Original:
Binary/text mode indicator.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
6)
End-of-file indicador de estado .
Original:
End-of-file status indicator.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
7)
Error indicador de estado .
Original:
Error status indicator.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
8)
El archivo indicador de posición (un objeto de tipo std::fpos_t), que, para flujos de caracteres de ancho, incluye el estado de análisis (un objeto de tipo mbstate_t) .
Original:
File position indicator (an object of type std::fpos_t), which, for wide character streams, includes the parse state (an object of type mbstate_t).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[editar] Funciones
Original: File access The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
se abre un archivo Original: opens a 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) | |
abrir una secuencia existente con un nombre diferente Original: open an existing stream with a different name The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
cierra un archivo Original: closes a 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) | |
sincroniza un flujo de salida con el archivo real Original: synchronizes an output stream with the actual 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) | |
cambia una secuencia de archivos entre el carácter amplio de E / S y el carácter limitado de I / O Original: switches a file stream between wide character I/O and narrow character I/O The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
establece el tampón para una secuencia de archivo Original: sets the buffer for a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
establece el tampón y su tamaño para una secuencia de archivo Original: sets the buffer and its size for a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
Original: Direct input/output The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
lee un archivo Original: reads from a 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) | |
escribe en un archivo Original: writes to a 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) | |
Original: Unformatted input/output The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Original: Narrow character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
recibe un carácter de una secuencia de archivo Original: gets a character from a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
recibe una cadena de caracteres a partir de una secuencia de archivo Original: gets a character string from a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
Escribe un carácter en una secuencia de archivo Original: writes a character to a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
escribe una cadena de caracteres en una secuencia de archivo Original: writes a character string to a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
dice un personaje de stdin Original: reads a character from stdin The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
lee una cadena de caracteres de stdin Original: reads a character string from stdin The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
escribe un carácter a stdout Original: writes a character to stdout The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
escribe una cadena de caracteres a stdout Original: writes a character string to stdout The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
pone un personaje nuevo en una secuencia de archivo Original: puts a character back into a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
Original: Wide character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
recibe un carácter ancho de una secuencia de archivo Original: gets a wide character from a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
obtiene una cadena amplia de una secuencia de archivo Original: gets a wide string from a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
escribe un carácter ancho a un secuencia de archivo Original: writes a wide character to a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
escribe una cadena ancha para una secuencia de archivo Original: writes a wide string to a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
lee un carácter ancho de stdin Original: reads a wide character from stdin The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
escribe un carácter ancho a stdout Original: writes a wide character to stdout The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
pone un carácter ancho de nuevo en una secuencia de archivo Original: puts a wide character back into a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
Original: Formatted input/output The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Original: Narrow/multibyte character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
lee la entrada con formato desde stdin, una secuencia de archivo o un tampón Original: reads formatted input from stdin, a file stream or a buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
(C++11)(C++11)(C++11) |
lee la entrada con formato de stdin, una secuencia de archivo o una buffer con lista de argumentos variable Original: reads formatted input from stdin, a file stream or a buffer using variable argument list The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) |
(C++11) |
Imprime la salida formateada para stdout, una secuencia de archivo o un búfer. (función) |
imprime el formato de salida a stdout, una secuencia de archivo o una buffer con lista de argumentos variable Original: prints formatted output to stdout, a file stream or a buffer using variable argument list The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
Original: Wide character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
lee la entrada formateado carácter ancho de stdin, una secuencia de archivo o un tampón Original: reads formatted wide character input from stdin, a file stream or a buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
(C++11)(C++11)(C++11) |
lee la entrada con formato de caracteres anchos de stdin, un stream archivo o un buffer usando la lista de argumentos variable Original: reads formatted wide character input from stdin, a file stream or a buffer using variable argument list The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) |
imprime la salida formateada carácter ancho a stdout, una secuencia de archivo o un tampón Original: prints formatted wide character output to stdout, a file stream or a buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
imprime el formato de salida de caracteres anchos a stdout, un stream archivo o un buffer usando la lista de argumentos variable Original: prints formatted wide character output to stdout, a file stream or a buffer using variable argument list The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
Original: File positioning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
devuelve el indicador de archivo posición actual Original: returns the current file position indicator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
obtiene el indicador de posición del archivo Original: gets the file position indicator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
desplaza el indicador de posición de archivo a una ubicación específica en un archivo Original: moves the file position indicator to a specific location in a 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) | |
desplaza el indicador de posición de archivo a una ubicación específica en un archivo Original: moves the file position indicator to a specific location in a 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) | |
mueve el indicador de posición de archivo al principio en un archivo Original: moves the file position indicator to the beginning in a 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) | |
Original: Error handling The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
borra los errores Original: clears errors The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
cheques para el final de archivo Original: checks for the end-of-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) | |
comprueba si hay un error de archivo Original: checks for a file error The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
muestra una cadena de caracteres correspondiente del error actual a stderr Original: displays a character string corresponding of the current error to stderr The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
Original: Operations on files The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
borra un archivo Original: erases a 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) | |
cambia el nombre de un archivo Original: renames a 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) | |
crea y abre un temporal, auto-eliminación de archivos Original: creates and opens a temporary, auto-removing 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) | |
devuelve un nombre de archivo único Original: returns a unique filename The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) |
[editar] Tipos
Definido en el archivo de encabezado
<cstdio> | |
Tipo
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
FILE | tipo, capaz de contener toda la información necesaria para controlar una corriente CI / O
Original: type, capable of holding all information needed to control a C I/O stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
fpos_t | tipo, capaz de especificar una posición única en un archivo
Original: type, capable of uniquely specifying a position in a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[editar] Macros
Definido en el archivo de encabezado
<cstdio> | |
stdinstdoutstderr |
expresión de tipo FILE* asociado con la entrada de stream expression FILE* tipo asociado con la salida de stream expression FILE* tipo asociado con la corriente de salida de error Original: expression of type FILE* associated with the input stream expression of type FILE* associated with the output stream expression of type FILE* associated with the error output stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante de macro) |
EOF |
expresión constante entera de int tipo y valor negativo Original: integer constant expression of type int and negative value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante de macro) |
FOPEN_MAX |
número de archivos que pueden estar abiertos al mismo tiempo Original: number of files that can be open simultaneously The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante de macro) |
FILENAME_MAX |
el tamaño necesario para una matriz de char a mantener más tiempo el nombre de archivo compatible Original: size needed for an array of char to hold the longest supported file name The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante de macro) |
BUFSIZ |
tamaño del búfer utilizado por std::setbuf Original: size of the buffer used by std::setbuf The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante de macro) |
_IOFBF_IOLBF_IONBF |
argumento para std::setbuf indicando búfer completo de E / O argument a la línea que indica std::setbuf búfer de E / O argument a std::setbuf indicando unbuffered I / O Original: argument to std::setbuf indicating fully buffered I/O argument to std::setbuf indicating line buffered I/O argument to std::setbuf indicating unbuffered I/O The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante de macro) |
SEEK_SETSEEK_CURSEEK_END |
argumento a std::fseek indicando busca de comienzo de la file argument a std::fseek indicando busca desde el position argument archivo actual a std::fseek indicando busca de final del archivo Original: argument to std::fseek indicating seeking from beginning of the file argument to std::fseek indicating seeking from the current file position argument to std::fseek indicating seeking from end of the file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante de macro) |
TMP_MAX |
número máximo de nombres de archivos únicos que pueden ser generados por std::tmpnam Original: maximum number of unique filenames that can be generated by std::tmpnam The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante de macro) |
L_tmpnam |
el tamaño necesario para una matriz de char para guardar el resultado de std::tmpnam Original: size needed for an array of char to hold the result of std::tmpnam The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante de macro) |