Is there any function in a standard C library which allow one to retrieve files with a particular extension like ".c"?
Asked
Active
Viewed 56 times
0
-
short answer is no. what is your OS? – jev Sep 26 '13 at 16:36
-
@jev Its linux debian – Shahzad Sep 26 '13 at 16:36
-
you can us the `exec` family of functions to call the usual unix utils (ls, grep etc) – jev Sep 26 '13 at 16:39
-
http://www.gnu.org/software/libc/manual/html_mono/libc.html#Calling-Glob – lurker Sep 26 '13 at 16:44
-
`system("find ...");` – devnull Sep 26 '13 at 17:01
-
@Shahzad: Do it need to be portable? – The Mask Sep 26 '13 at 17:15
1 Answers
0
There are no standard C library functions that do that. There are platform-specific functions that do that.
EDIT: If you're on Debian, try looking up the documentation for glob
or wordexp
. The documentation for glob
even has an example, looking up .c
files, just as you wish.

ldav1s
- 15,885
- 2
- 53
- 56