browsing in a directory

1

13gurpreetsingh

hi friends,
my program demands that we need to list the information in all the
files present in a directory ,say xxxx and the files present in all
the subdirectories in this xxxx directory. please help me how can we
achieve this.
My thought:If there is any command which could give me atleast the
list of all the subdirectories within a particular directory( in one
go or one at a time) then we can store all those names in an array of
strings and change directory repeatidely( recursively); please tell me
if this approach is correct and whether such a command is available in
c/c++
 
B

Ben Pfaff

my program demands that we need to list the information in all the
files present in a directory ,say xxxx and the files present in all
the subdirectories in this xxxx directory. please help me how can we
achieve this.

You'd be better off asking this question in a newsgroup dedicated
to your particular platform, as the answer is
implementation-specific.
 
W

Walter Roberson

hi friends,
my program demands that we need to list the information in all the
files present in a directory ,say xxxx and the files present in all
the subdirectories in this xxxx directory. please help me how can we
achieve this.

FAQ. There is no way to do that in standard C. The C language has
no concept of directories.

What you want to do might perhaps be possible using operating-
system extensions on whatever platform you are using, but
you will need to ask about those in a newsgroup specific to
your operating system.
 
J

John Bode

hi friends,
my program demands that we need to list the information in all the
files present in a directory ,say xxxx and the files present in all
the subdirectories in this xxxx directory. please help me how can we
achieve this.
My thought:If there is any command which could give me atleast the
list of all the subdirectories within a particular directory( in one
go or one at a time) then we can store all those names in an array of
strings and change directory repeatidely( recursively); please tell me
if this approach is correct and whether such a command is available in
c/c++

Neither C nor C++ provide a built-in method for managing files and
directories; you will have to rely on platform-specific libraries to
accomplish this task. In Unix- and Linux-based systems, you'd use
routines in the dirent library. I don't know what the equivalents
would be for Windows or Mac OS X.
 
C

CBFalconer

my program demands that we need to list the information in all the
files present in a directory ,say xxxx and the files present in all
the subdirectories in this xxxx directory. please help me how can we
achieve this.
My thought:If there is any command which could give me atleast the
list of all the subdirectories within a particular directory( in one
go or one at a time) then we can store all those names in an array of
strings and change directory repeatidely( recursively); please tell me
if this approach is correct and whether such a command is available in
c/c++

Directories are system dependant, and not part of standard C. Go
to a newsgroup that deals with your system. The subject is
off-topic here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top