.\" -*- nroff -*- .\" .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Modified by Michael Haardt .\" Modified Wed Jul 21 22:10:52 1993 by Rik Faith .\" Modified 15 April 1995 by Michael Chastain : .\" Added 'fchdir'. .\" Fix bugs in error section. .\" Modified Mon Oct 21 23:05:29 EDT 1996 by Eric S. Raymond .\" Modified by Joseph S. Myers , 970821 .\" .TH CHDIR 2 "21/08/1997" "Linux 2.0.30" "Manual do Programador Linux" .SH NOME chdir, fchdir \- altera o diretório de trabalho .SH SINOPSE .B #include .sp .BI "int chdir(const char *" path ); .br .BI "int fchdir(int " fd ");" .SH DESCRIÇÃO .B chdir altera o diretório atual para o específicado em .IR path . .PP .B fchdir é identico a .BR chdir , somente que o diretório é fornecido com um descritor de arquivo aberto. .SH "VALORES RETORNADOS" Em caso de successo, zero é retornado. Caso contrário, \-1 é retornado, e .I errno é selecionado adequadamente. .SH ERROS Dependendo do sistema de arquivos, outros erros podem ser retornados. Os erros mais gerais para .B chdir são listados abaixo: .TP .B EFAULT .I path aponta para fora do seu espaço de endereço acessível. .TP .B ENAMETOOLONG .I path é muito longo. .TP .B ENOENT O arquivo não existe. .TP .B ENOMEM Memória de kernel disponível é insufuciente. .TP .B ENOTDIR Um componete do .I path Não é um diretório. .TP .B EACCES Permissão de busco é negada em um componente do .IR path . .TP .B ELOOP Muitas ligações simbólicas foram encontradas na resolução do .IR path . .TP .B EIO Um erro de E/S ocorreu. .PP Os erros gerais para .B fchdir são listados abaixo: .TP .B EBADF .I fd não é válido como descritor de arquivos. .TP .B EACCES Permissão de procura foi negada no diretório aberto em .IR fd . .SH "DE ACORDO COM" A chamada .B chdir é compatível com SVr4, SVID, POSIX, X/OPEN, BSD 4.4. SVr4 documenta condições de erro adicionais EINTR, ENOLINK, e EMULTIHOP mas não ENOMEM. POSIX.1 não tem as condições de erro ENOMEM ou ELOOP. X/OPEN não tem as condições de erro EFAULT, ENOMEM ou EIO. .B fchdir é compatível com SVr4, BSD 4.4 e X/OPEN. SVr4 documenta condições de erro adicionais EIO, EINTR, ENOLINK. X/OPEN não tem as condições de erro EINTR e EIO. .SH "VEJA TAMBÉM" .BR getcwd (3), .BR chroot (2) .SH TRADUZIDO POR LDP-BR em 22/08/2000. \&\fR\&\f(CWAndré L. Fassone Canova (tradução)\fR \&\fR\&\f(CWxxxxxxxxxxxxxxxxxxxxxxxxx (revisão)\fR