Re: A function for ls?



>>     is there a library function that gives the contents of a directory?
>> Something like 'ls'... or a way to do it using other functions?
>
>It's platform dependent.  On a POSIX-compliant system you can
>
>#include <dirent.h>
>
>end use functions such as opendir(), readdir(), ...  These all have
>manual pages e.g. man 3 opendir.

see also ftw(3) for an easy way to recursively walk a directory tree.

--p




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]