delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/09/13:51:33

Message-ID: <000401bdc3bd$8ec5b9c0$0b1f1bc4@enterprise-z>
Reply-To: "=?iso-8859-1?Q?Jorge_Iv=E1n_Meza_Mart=EDnez?=" <jimeza AT usa DOT net>
From: "=?iso-8859-1?Q?Jorge_Iv=E1n_Meza_Mart=EDnez?=" <jimeza AT usa DOT net>
To: <djgpp AT delorie DOT com>
Subject: readdir question
Date: Sun, 9 Aug 1998 02:48:33 -0500
MIME-Version: 1.0

Hi,

I have to read the file names from certain directory, I am using:

|#include <dirent.h>
|struct dirent *readdir(DIR *dir);
|
|DIR *d = opendir( argv[1] );
|
|while ((de = readdir(d)))
|    cout >> de->d_name;
|
|closedir ( d );

but it does not read from other subdirectories, just the directory that I
tell him and not its subdirectories.

from the "LibC Reference" I understood that setting "__opendir_flags"
variable to "__OPENDIR_FIND_HIDDEN", the "opendir ( ... )" would seek for
files thru subdirectories, I added to my program:

extern int __opendir_flags;
__opendir_flags = __OPENDIR_FIND_HIDDEN;

but nothing changes, all is the same than before.

can you help me please ?

Jorge Iván Meza Martínez
jimeza AT usa DOT net
http://members.xoom.com/THP


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019