wpadami-forks / iphone-dev

Automatically exported from code.google.com/p/iphone-dev
0 stars 0 forks source link

readdir in C lib doesn't work #148

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. program one simple file such like below
"
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>

main(){
struct dirent *entry=0;
DIR* dirp=opendir("/var/root");
if (dirp==0)
printf("open dir error\n");
seekdir("/var/root");
  while (entry = readdir (dirp)){
    if (entry->d_name == "\0")
        printf (" d_name is NULL/n");
    else
    printf("the name %s, size is %d\n",entry->d_name, entry->d_namlen);
}
}

"
2. compile it and then run it on iphone with 2.0 toolchain, the result is 
nothing, it see nothing in 
the directory "/var/root" although there are lots files under it.

What is the expected output? What do you see instead?
should give me back the under contents of /var/root

What version of the product are you using? On what operating system?
iphone 2.0 toolchain

Please provide any additional information below.

Original issue reported on code.google.com by daqulazh...@gmail.com on 2 Aug 2008 at 9:59