File: ftw.3

package info (click to toggle)
manpages-es 1.24a-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 4,256 kB
  • ctags: 7
  • sloc: makefile: 66; sh: 62
file content (81 lines) | stat: -rw-r--r-- 3,342 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.\" Copyright (c) 1993 Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de), Sun Jul 18 17:47:18 MET DST 1993
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
.\" USA.
.\"
.\" Modified Sun Jul 25 11:02:22 1993 by Rik Faith (faith@cs.unc.edu)
.\" Translated into Spanish Thu Jan 22 1998 by Gerardo Aburruzaga
.\" Garca <gerardo.aburruzaga@uca.es>
.\"
.TH FTW 3 "10 Julio 1993" "Linux" "Manual del Programador de Linux"
.SH NOMBRE
ftw \- recorre un rbol de ficheros
.SH SINOPSIS
.B #include <ftw.h>
.sp
.BI "int ftw(const char *" directorio ", int (*" ptrfunc
.BI ")(const char *" fichero ", struct stat *" sb ", int " flag "), int " profun );
.SH DESCRIPCIN
\fBftw\fP() recorre un rbol de directorios empezando por el 
\fIdirectorio\fP indicado.  Para cada entrada encontrada en el rbol,
llama a \fIptrfunc\fP con el nombre de camino completo de la entrada,
relativa a \fIdirectorio\fP, un puntero a la estructura
.BR stat (2)
para la entrada, y un int, cuyo valor ser uno de los siguientes:
.RS
.ta 1i
.nf
\fBFTW_F\fP	El tem es un fichero normal
\fBFTW_D\fP	EL tem es un directorio
\fBFTW_NS\fP	stat ha fallado en el tem
\fBFTW_DNR\fP	El tem es un directorio que no puede leerse
.fi
.RE
Atencin: Cualquier otra cosa que no sea un directorio, como enlaces
simblicos, obtiene la etiqueta \fBFTW_F\fP.
.PP
\fBftw\fP() se llama a s misma recursivamente para atravesar los
directorios que encuentra.
Para evitar el uso de todos los descriptores de fichero de un
programa, el argumento \fIprofun\fP especifica el nmero de
directorios abiertos simultneamente. Cuando la profundidad es
sobrepasada, \fBftw\fP() se ralentizar porque los directorios debern
cerrarse y volverse a abrir.
.PP
Para detener el recorrido por el rbol, \fIptrfunc\fP devuelve un
valor no-cero; este valor se convertir en el devuelto por
\fBftw\fP().  De otro modo, \fBftw\fP() continuar hasta que haya
recorrido el rbol entero, en cuyo caso devolver cero, o hasta que
ocurra un error como un fallo de
.BR malloc (3),
en cuyo caso devolver \-1.
.PP
Puesto que  \fBftw()\fP usa estructuras de datos dinmicas, la nica
forma segura de salir de un recorrido por un rbol es devolver un
valor no cero. Para manejar interrupciones, por ejemplo, marque que ha
ocurrido una interrupcin y devuelva un valor no-cero\(emno emplee
.BR longjmp (3)
a menos que el programa vaya a terminar.

.SH "CONFORME A"
AES, SVID2, SVID3, XPG2, XPG3 y XPG4

.SH "VASE TAMBIN"
.BR stat (2)