Code:
if(!dir_pointer)
{
printf("Error reading from directory\n");
return -1;
}
Which means it has trouble opening the directory you want it to search in.
This can happen due to many things, one is that the opendir() function is slightly different on your system than on mine, another thing could be theres a typo in the directory argument, yet another one could be that my program fails, when it has to open a directory starting with '/' as well as a noumerous others..
But on my system it has no problem at all:
Quote:
{105} ~> ls /usr/lib/*.15
/usr/lib/liblber.so.2.0.15
/usr/lib/libldap.so.2.0.15
/usr/lib/libldap_r.so.2.0.15
{106} ~> ./di .15 /usr/lib
Found files:
liblber.so.2.0.15
libldap.so.2.0.15
libldap_r.so.2.0.15
|
So from my point of view it is working as expected.
This is one of the reasons I didn't wanted to get into this in teh first place, since it is so system specific, when dealing with something like file/directory structures.