std::fseek
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í. |
| Definido en el archivo de encabezado <cstdio>
|
||
int fseek( std::FILE* stream, long offset, int origin ); |
||
Establece el indicador de posición del fichero para el
stream secuencia de archivo de la siguiente manera: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.
Si el
stream está abierto en modo binario, la nueva posición es exactamente offset bytes medido desde el comienzo de la descarga es origin es SEEK_SET, desde la posición actual del archivo si se origin SEEK_CUR, y desde el final del archivo si es origin SEEK_END. Algunas secuencias binarias no admita la 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.
Si el
stream está abierto en modo de texto, los únicos valores admitidos para offset son cero (que funciona con cualquier origin) y un valor devuelto por una llamada anterior a std::ftell en una corriente asociada con el mismo archivo (que sólo funciona con 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.
Además de cambiar el indicador de posición del fichero,
fseek deshace los efectos de std::ungetc y borra la condición de fin de archivo, si procede .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.
Si una lectura o escritura error, el indicador de error de la corriente ( std::ferror) se ajusta la posición del archivo y no se ve afectada .
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 | - | archivo continuo a 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 para cambiar la posición relativa al origen
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 | - | posición a la que se añade
offset. Puede tener uno de los siguientes 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 sobre el éxito, valor distinto de cero de otra manera .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.
Ejemplo
| Esta sección está incompleta Razón: sin ejemplo |
Ver tambié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) | |
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) | |
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) | |
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) | |
Documentación de C para fseek
| |