What do you know about reading directories in C?
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 36
Well, you can use the shell command to write the list into a file, then your program can read that file to retrieve the files.
Since I'm not familiar with a "find shell command". what OS are you using? When dealing with directories, that's an important piece of information.
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 36
Like WaltP said, you should have the command write to a file and then read from that file. You should probably use the "system" function in stdlib.h. You don't have to "embed" a shell inside of your C program. Also, the good thing about the find command is it lists all the files it finds line by line, so you only need to use a function like "fgets" to read the filenames from the file generated from find's output.
chrjs
Junior Poster in Training
96 posts since Feb 2011
Reputation Points: 58
Solved Threads: 20
Skill Endorsements: 0
Question Answered as of 2 Years Ago by
WaltP
and
chrjs