Click to See Complete Forum and Search --> : ls command in C


Christian Olsson
04-01-2002, 06:20 AM
How can I get all files in a directory to an array? I was thinking something like perl statment @list = qx{ls}; but in C.

The Kooman
04-01-2002, 12:14 PM
Originally posted by Christian Olsson:
<STRONG>How can I get all files in a directory to an array? I was thinking something like perl statment @list = qx{ls}; but in C.</STRONG>

man opendir
man readdir
man closedir
man rewinddir
man seekdir
man telldir
man scandir - even has an example (at least on my installation ;))!