std::fseek
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| Definido no cabeçalho <cstdio>
|
||
int fseek( std::FILE* stream, long offset, int origin ); |
||
Define o indicador de posição de arquivo do fluxo
stream arquivo da seguinte maneira:Original:
Sets the file position indicator for the file stream
stream as follows: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.
Se o
stream está aberto no modo binário, a nova posição é exactamente medidos offset bytes a partir do início do processo é origin SEEK_SET é, a partir da posição actual ficheiro se origin é SEEK_CUR e, a partir do final do ficheiro, se é origin SEEK_END. Alguns fluxos binários podem não suportar a SEEK_END.Original:
If the
stream is open in binary mode, the new position is exactly offset bytes measured from the beginning of the file is origin is SEEK_SET, from the current file position if origin is SEEK_CUR, and from the end of the file if origin is SEEK_END. Some binary streams may not support the SEEK_END.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.
Se o
stream está aberto em modo texto, os valores só são suportados para offset zero (que funciona com qualquer origin) e um valor retornado por uma chamada anterior para std::ftell em um fluxo associado com o mesmo arquivo (que só funciona com origin de SEEK_SET.Original:
If the
stream is open in text mode, the only supported values for offset are zero (which works with any origin) and a value returned by an earlier call to std::ftell on a stream associated with the same file (which only works with origin of SEEK_SET.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.
Além de mudar o indicador de posição do arquivo,
fseek desfaz os efeitos da std::ungetc e limpa o fim do estatuto de arquivo, se for o caso.Original:
In addition to changing the file position indicator,
fseek undoes the effects of std::ungetc and clears the end-of-file status, if applicable.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.
Se uma leitura ou escrita de erro ocorre, o indicador de erro para o fluxo ( std::ferror) é definida a posição do arquivo e não é afetado.
Original:
If a read or write error occurs, the error indicator for the stream (std::ferror) is set and the file position is unaffected.
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.
Parâmetros
| stream | - | arquivo de fluxo de modificar
Original: file stream to modify The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| offset | - | número de caracteres a deslocar a posição relativa à origem
Original: number of characters to shift the position relative to origin The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| origin | - | posição para a qual
offset é adicionado. Ele pode ter um dos seguintes valores: SEEK_SET, SEEK_CUR, SEEK_ENDOriginal: position to which offset is added. It can have one of the following values: SEEK_SET, SEEK_CUR, SEEK_ENDThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Valor de retorno
0 no sucesso valor diferente de zero, caso contrário.Original:
0 upon success, nonzero value otherwise.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.
Exemplo
| Esta seção está incompleta Motivo: sem exemplo |
Veja também
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. You can help to correct and verify the translation. Click here for instructions. (função) | |
fica o indicador de posição de arquivo 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. (função) | |
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. You can help to correct and verify the translation. Click here for instructions. (função) | |
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. You can help to correct and verify the translation. Click here for instructions. (função) | |
Documentação C para fseek
| |