.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1990, 1991 The Regents of the University of California. .\" All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Chris Torek and the American National Standards Committee X3, .\" on Information Processing Systems. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" %%%LICENSE_END .\" .\" @(#)fseek.3 6.11 (Berkeley) 6/29/91 .\" .\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH FSEEK 3 "30 abril 2018" GNU "Manual do Programador do Linux" .SH NOME fgetpos, fseek, fsetpos, ftell, rewind \- reposiciona um fluxo .SH SINOPSE \fB#include \fP .PP \fBint fseek(FILE *\fP\fIfluxo\fP\fB, long \fP\fIdeslocamento\fP\fB, int \fP\fIde_onde\fP\fB);\fP .PP \fBlong ftell(FILE *\fP\fIfluxo\fP\fB);\fP .PP \fBvoid rewind(FILE *\fP\fIfluxo\fP\fB);\fP .PP \fBint fgetpos(FILE *\fP\fIfluxo\fP\fB, fpos_t *\fP\fIpos\fP\fB);\fP .PP \fBint fsetpos(FILE *\fP\fIfluxo\fP\fB, const fpos_t *\fP\fIpos\fP\fB);\fP .SH DESCRIÇÃO A função \fBfseek\fP() define o indicador de posição de arquivo do fluxo apontado por \fIfluxo\fP. A nova posição, medida em bytes, é obtida pelo acréscimo de \fIdeslocamento\fP bytes à posição especificada por \fIde_onde\fP. Se \fIde_onde\fP é definido para \fBSEEK_SET\fP, \fBSEEK_CUR\fP ou \fBSEEK_END\fP, o deslocamento é relativo ao início do arquivo, ao indicador de posição atual, ou ao fim de arquivo, respectivamente. Uma chamada bem sucedida à função \fBfseek\fP() limpa o indicador de fim de arquivo para o fluxo e desfaz qualquer efeito da função \fBungetc\fP(3) no mesmo fluxo. .PP A função \fBftell\fP() obtém o valor corrente do indicador de posição de arquivo do fluxo apontado por \fIfluxo\fP. .PP A função \fBrewind\fP() define o indicador de posição de arquivo do fluxo apontado por \fIfluxo\fP para o início do arquivo. É equivalente a: .PP .RS (void) fseek(stream, 0L, SEEK_SET) .RE .PP exceto pelo fato de que o indicador de erro do fluxo também é limpo (veja \fBclearerr\fP(3)). .PP As funções \fBfgetpos\fP() e \fBfsetpos\fP() são interfaces alternativas equivalentes a \fBftell\fP() e \fBfseek\fP() (com \fIde_onde\fP definido para \fBSEEK_SET\fP), definindo e armazenando o valor atual do deslocamento do arquivo do objeto referenciado por \fIpos\fP. Em alguns sistemas não\-UNIX, um objeto \fBfpos_t\fP pode ser um objeto complexo e estas rotinas podem ser a única maneira portável de reposicionar um fluxo de texto. .SH "VALOR DE RETORNO" A função \fBrewind\fP() não retorna valor. Em caso de término bem\-sucedido, \fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP() retornam 0, e \fBftell\fP() retorna o deslocamento atual. Caso contrário, \-1 é retornado e \fIerrno\fP é definido para indicar o erro. .SH ERROS .TP \fBEINVAL\fP O argumento \fIde_onde\fP de \fBfseek\fP() não era \fBSEEK_SET\fP, \fBSEEK_END\fP ou \fBSEEK_CUR\fP. Ou: o deslocamento de arquivo resultando seria negativo. .TP \fBESPIPE\fP O descritor de arquivo subjacente ao \fIfluxo\fP não é pesquisável (por exemplo, ele se refere a um encadeamento, FIFO ou soquete). .PP As funções \fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP() e \fBftell\fP() também podem falhar e definir \fIerrno\fP para qualquer um dos erros especificados para as rotinas \fBfflush\fP(3), \fBfstat\fP(2), \fBlseek\fP(2) e \fBmalloc\fP(3). .SH ATRIBUTOS Para uma explicação dos termos usados nesta seção, consulte \fBattributes\fP(7). .TS allbox; lbw27 lb lb l l l. Interface Atributo Valor T{ \fBfseek\fP(), \fBftell\fP(), \fBrewind\fP(), .br \fBfgetpos\fP(), \fBfsetpos\fP() T} Thread safety MT\-Safe .TE .sp 1 .SH "DE ACORDO COM" POSIX.1\-2001, POSIX.1\-2008, C89, C99. .SH "VEJA TAMBÉM" \fBlseek\fP(2), \fBfseeko\fP(3) .SH COLOFÃO Esta página faz parte da versão 5.10 do projeto Linux \fIman\-pages\fP. Uma descrição do projeto, informações sobre relatórios de bugs e a versão mais recente desta página podem ser encontradas em \%https://www.kernel.org/doc/man\-pages/. .PP .SH TRADUÇÃO A tradução para português brasileiro desta página man foi criada por Rubens de Jesus Nogueira , André Luiz Fassone e Rafael Fontenelle . . .PP Esta tradução é uma documentação livre; leia a .UR https://www.gnu.org/licenses/gpl-3.0.html Licença Pública Geral GNU Versão 3 .UE ou posterior para as condições de direitos autorais. Nenhuma responsabilidade é aceita. .PP Se você encontrar algum erro na tradução desta página de manual, envie um e-mail para .MT debian-l10n-portuguese@lists.debian.org a lista de discussão de tradutores .ME .