C-style file input/output - cppreference.com
O subconjunto CI / O do C + + biblioteca padrão implementa C-estilo fluxo de entrada / saída operações. O cabeçalho <cstdio> fornece suporte à operação genérica arquivo e funções de suprimentos com estreitas e multibyte caracteres de entrada / saída de recursos, eo cabeçalho <cwchar> fornece funções com a entrada de caracteres de largura / capacidades de saída.
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.
Fluxos C são objetos de std::FILE tipo que só podem ser acessados e manipulados através de ponteiros da Nota tipo std::FILE* (: embora possa ser possível criar um objeto local de std::FILE tipo por dereferencing e copiar um FILE* válido, usando o endereço de tal cópia em as funções de I / O é um comportamento indefinido). Cada fluxo C está associada a um dispositivo externo físico (arquivo, fluxo de entrada padrão, impressora, porta serial, 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.
Fluxos C pode ser usado tanto para entrada como não formatado e formatado e saída. Eles são sensíveis à localidade e pode realizar amplas / multibyte conversões necessárias. Ao contrário de C + + riachos, onde cada fluxo está associado com a sua própria localidade, todos os fluxos de C acessar o objeto mesmo local: o mais recentemente instalado com 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.
Além do sistema de informações específicas necessárias para acessar o dispositivo (por exemplo, um descritor de arquivo POSIX), cada objeto de fluxo de C tem o seguinte:
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.
1)
Largura de caractere: estreita ou larga
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.
2)
Buffer estado: unbuffered, linha-tampão, com buffer.
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.
3)
O tampão, o qual pode ser substituído por uma fonte externa, tampão fornecido pelo utilizador.
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.
4)
I / O modo: de entrada, de saída, ou de atualização (entrada e saída).
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.
5)
Binário / indicador do modo 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.
6)
Fim-de-arquivo indicador de status.
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.
7)
Indicador de status de erro.
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.
8)
Indicador de posição do arquivo (um objeto do tipo std::fpos_t), que, para fluxos de caracteres de largura, inclui o estado parse (um objeto do 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.
Funções
Arquivo de acesso Original: File access The text has been machine-translated via Google Translate. | |
abre um arquivo Original: opens a file The text has been machine-translated via Google Translate. (função) [edit] | |
abrir um córrego existente com um nome diferente Original: open an existing stream with a different name The text has been machine-translated via Google Translate. (função) [edit] | |
fecha um arquivo Original: closes a file The text has been machine-translated via Google Translate. (função) [edit] | |
sincroniza um fluxo de saída com o arquivo real Original: synchronizes an output stream with the actual file The text has been machine-translated via Google Translate. (função) [edit] | |
muda um fluxo de arquivos entre o personagem de largura I / O e caráter estreito 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. (função) [edit] | |
define o buffer para um fluxo de arquivo Original: sets the buffer for a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
define o tampão e do seu tamanho para um fluxo de arquivo Original: sets the buffer and its size for a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
Directa de entrada / saída Original: Direct input/output The text has been machine-translated via Google Translate. | |
lê um arquivo Original: reads from a file The text has been machine-translated via Google Translate. (função) [edit] | |
grava em um arquivo Original: writes to a file The text has been machine-translated via Google Translate. (função) [edit] | |
Não formatado entrada / saída Original: Unformatted input/output The text has been machine-translated via Google Translate. | |
Caráter estreito Original: Narrow character The text has been machine-translated via Google Translate. | |
recebe um personagem de um fluxo de arquivo Original: gets a character from a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
recebe uma cadeia de caracteres a partir de um fluxo de arquivo Original: gets a character string from a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
escreve um personagem para um fluxo de arquivo Original: writes a character to a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
escreve uma seqüência de caracteres para um fluxo de arquivo Original: writes a character string to a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
lê um caracter do stdin Original: reads a character from stdin The text has been machine-translated via Google Translate. (função) [edit] | |
lê uma cadeia de caracteres de stdin Original: reads a character string from stdin The text has been machine-translated via Google Translate. (função) [edit] | |
escreve um personagem para stdout Original: writes a character to stdout The text has been machine-translated via Google Translate. (função) [edit] | |
escreve uma cadeia de caracteres para stdout Original: writes a character string to stdout The text has been machine-translated via Google Translate. (função) [edit] | |
coloca um personagem de volta em um fluxo de arquivo Original: puts a character back into a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
Caráter de largura Original: Wide character The text has been machine-translated via Google Translate. | |
recebe um caractere largo de um fluxo de arquivo Original: gets a wide character from a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
recebe uma seqüência de largura a partir de um fluxo de arquivo Original: gets a wide string from a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
escreve um caráter amplo para um fluxo de arquivo Original: writes a wide character to a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
escreve uma string de gama a um fluxo de arquivo Original: writes a wide string to a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
lê um caractere largo de stdin Original: reads a wide character from stdin The text has been machine-translated via Google Translate. (função) [edit] | |
escreve um caráter amplo para stdout Original: writes a wide character to stdout The text has been machine-translated via Google Translate. (função) [edit] | |
coloca um caractere largo de volta em um fluxo de arquivo Original: puts a wide character back into a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
Formatado de entrada / saída Original: Formatted input/output The text has been machine-translated via Google Translate. | |
Estreito / multibyte personagem Original: Narrow/multibyte character The text has been machine-translated via Google Translate. | |
lê entrada formatada de stdin, um fluxo de arquivo ou um tampão Original: reads formatted input from stdin, a file stream or a buffer The text has been machine-translated via Google Translate. (função) [edit] | |
(C++11) |
lê entrada formatada de stdin, um fluxo de arquivo ou um buffer Original: reads formatted input from stdin, a file stream or a buffer The text has been machine-translated via Google Translate. (função) [edit] |
(C++11) |
impressões saída formatada para stdout, um fluxo de arquivo ou um tampão Original: prints formatted output to stdout, a file stream or a buffer The text has been machine-translated via Google Translate. (função) [edit] |
impressões saída formatada para stdout, um fluxo de arquivo ou um buffer Original: prints formatted output to stdout, a file stream or a buffer The text has been machine-translated via Google Translate. (função) [edit] | |
Caráter de largura Original: Wide character The text has been machine-translated via Google Translate. | |
lê a entrada de caracteres formatada variedade de stdin, um fluxo de arquivo ou um tampão Original: reads formatted wide character input from stdin, a file stream or a buffer The text has been machine-translated via Google Translate. (função) [edit] | |
(C++11) |
lê a entrada de caracteres formatada variedade de stdin, um stream Original: reads formatted wide character input from stdin, a file stream The text has been machine-translated via Google Translate. (função) [edit] |
impressões formatado saída de caracteres de largura para stdout, um fluxo de arquivo ou um tampão Original: prints formatted wide character output to stdout, a file stream or a buffer The text has been machine-translated via Google Translate. (função) [edit] | |
impressões formatado saída de caracteres de largura para stdout, um stream Original: prints formatted wide character output to stdout, a file stream The text has been machine-translated via Google Translate. (função) [edit] | |
Arquivo de posicionamento Original: File positioning The text has been machine-translated via Google Translate. | |
retorna o indicador de posição de arquivo atual Original: returns the current file position indicator The text has been machine-translated via Google Translate. (função) [edit] | |
fica o indicador de posição de arquivo Original: gets the file position indicator The text has been machine-translated via Google Translate. (função) [edit] | |
move o indicador de posição de arquivo para um local específico em um arquivo Original: moves the file position indicator to a specific location in a file The text has been machine-translated via Google Translate. (função) [edit] | |
move o indicador de posição de arquivo para um local específico em um arquivo Original: moves the file position indicator to a specific location in a file The text has been machine-translated via Google Translate. (função) [edit] | |
move o indicador de posição do arquivo para o início em um arquivo Original: moves the file position indicator to the beginning in a file The text has been machine-translated via Google Translate. (função) [edit] | |
De tratamento de erros Original: Error handling The text has been machine-translated via Google Translate. | |
elimina erros Original: clears errors The text has been machine-translated via Google Translate. (função) [edit] | |
cheques para o fim-de-arquivo Original: checks for the end-of-file The text has been machine-translated via Google Translate. (função) [edit] | |
verifica um erro de arquivo Original: checks for a file error The text has been machine-translated via Google Translate. (função) [edit] | |
exibe uma seqüência de caracteres correspondente do erro atual para stderr Original: displays a character string corresponding of the current error to stderr The text has been machine-translated via Google Translate. (função) [edit] | |
Operações em arquivos Original: Operations on files The text has been machine-translated via Google Translate. | |
apaga um arquivo Original: erases a file The text has been machine-translated via Google Translate. (função) [edit] | |
Renomeia um arquivo Original: renames a file The text has been machine-translated via Google Translate. (função) [edit] | |
cria e abre um temporário, arquivo auto de remoção Original: creates and opens a temporary, auto-removing file The text has been machine-translated via Google Translate. (função) [edit] | |
retorna um nome único Original: returns a unique filename The text has been machine-translated via Google Translate. (função) [edit] | |
Tipos
Defined in header | |
Tipo Original: Type The text has been machine-translated via Google Translate. |
Definition |
FILE
|
tipo, capaz de reter todos os dados necessários para controlar um fluxo de 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. |
fpos_t
|
tipo, capaz de especificar de forma exclusiva uma posição em um arquivo Original: type, capable of uniquely specifying a position in a file The text has been machine-translated via Google Translate. |
Macros
Defined in header | |
stdin |
expressão do tipo Original: expression of type The text has been machine-translated via Google Translate. (macro constante) |
EOF |
expressão constante inteira de Original: integer constant expression of type The text has been machine-translated via Google Translate. (macro constante) |
FOPEN_MAX |
número de arquivos que podem ser abertas simultaneamente Original: number of files that can be open simultaneously The text has been machine-translated via Google Translate. (macro constante) |
FILENAME_MAX |
tamanho necessário para uma matriz de char para segurar o maior nome de arquivo suportado Original: size needed for an array of char to hold the longest supported file name The text has been machine-translated via Google Translate. (macro constante) |
BUFSIZ |
tamanho da memória tampão usada pelo std::setbuf Original: size of the buffer used by std::setbuf The text has been machine-translated via Google Translate. (macro constante) |
_IOFBF |
argumento para std::setbuf indicando fully buffered I / O Original: argument to std::setbuf indicating fully buffered I/O The text has been machine-translated via Google Translate. (macro constante) |
SEEK_SET |
argumento para std::fseek indicando buscando de início do file Original: argument to std::fseek indicating seeking from beginning of the file The text has been machine-translated via Google Translate. (macro constante) |
TMP_MAX |
número máximo de nomes de ficheiros originais que podem ser gerados 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. (macro constante) |
L_tmpnam |
tamanho necessário para uma matriz de char para segurar o 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. (macro constante) |