opendir, fdopendir - abre un directorio
Biblioteca Estándar C (libc, -lc)
#include <sys/types.h>
#include <dirent.h>
DIR *opendir(const char *nombre);
DIR *fdopendir(int fd);
fdopendir():
Desde glibc 2.10:
_POSIX_C_SOURCE >= 200809L
Antes de glibc 2.10:
_GNU_SOURCE La función opendir() abre un flujo de directorio correspondiente al directorio nombre, y devuelve un puntero al flujo de directorio. El flujo se sitúa en la primera entrada del directorio.
The fdopendir() function is like opendir(), but returns a directory stream for the directory referred to by the open file descriptor fd. After a successful call to fdopendir(), fd is used internally by the implementation, and should not otherwise be used by the application.
The opendir() and fdopendir() functions return a pointer to the directory stream. On error, NULL is returned, and errno is set to indicate the error.
- EACCES
- Permiso denegado.
- EBADF
- fd is not a valid file descriptor opened for reading.
- EMFILE
- Se ha alcanzado el límite de descriptores de archivo abiertos para cada proceso.
- ENFILE
- Se ha alcanzado el límite máximo de archivos abiertos para el conjunto del sistema.
- ENOENT
- El directorio no existe o nombre es una cadena vacía.
- ENOMEM
- Memoria insuficiente para completar la operación.
- ENOTDIR
- nombre no es un directorio.
fdopendir() is available since glibc 2.4.
Para obtener una explicación de los términos usados en esta sección, véase attributes(7)EN.
| Interfaz | Atributo | Valor |
| opendir(), fdopendir() | Seguridad del hilo | Multi-hilo seguro |
opendir() is present on SVr4, 4.3BSD, and specified in POSIX.1-2001. fdopendir() is specified in POSIX.1-2008.
Filename entries can be read from a directory stream using readdir(3)EN.
El descriptor de fichero asociado al flujo de directorio puede ser obtenido usando dirfd(3).
The opendir() function sets the close-on-exec flag for the file descriptor underlying the DIR *. The fdopendir() function leaves the setting of the close-on-exec flag unchanged for the file descriptor, fd. POSIX.1-200x leaves it unspecified whether a successful call to fdopendir() will set the close-on-exec flag for the file descriptor, fd.
La traducción al español de esta página del manual fue creada por Urko Lusa <ulusa@lacueva.ddns.org>, Juan Piernas <piernas@ditec.um.es> y Miguel Pérez Ibars <mpi79470@alu.um.es>
Esta traducción es documentación libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD.
Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a debian-l10n-spanish@lists.debian.org.