Problems by listing files opendir (".")
Markus Schmitz
markus_schmitz_b at yahoo.de
Fri May 4 14:47:40 UTC 2001
Hello,
I run RTEMS on cygwin.
I tried to list the files in a directory,
but all I got were empty strings?
#include <stdio.h>
#include<bsp.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<dirent.h>
#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<string.h>
#include<errno.h>
#include <fcntl.h>
rtems_task Init(rtems_task_argument ignored)
{
DIR *dp;
struct dirent *dirp;
dirp = new dirent;
if ( (dp = opendir (".")) == NULL)
{printf("can`t open Directory");}
else
{
while( (dirp = readdir(dp)) != NULL)
{
printf("d_ino %d, d_off %ld d_reclen %d d_namlen
%d d_name %s\n", dirp->d_ino, dirp->d_off,
dirp->d_reclen, dirp->d_namlen, dirp->d_name);
}
}
closedir(dp);
exit(0);
}
/* configuration information */
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 100
#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 10
#define CONFIGURE_MAXIMUM_PERIODS 1
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 2
#define CONFIGURE_MAXIMUM_SEMAPHORE 2
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
#include <confdefs.h>
$ lstest6.exe
d_ino 1627903676, d_off 1627903676 d_reclen 0 d_namlen
0 d_name
d_ino 1627903676, d_off 1627903676 d_reclen 0 d_namlen
0 d_name
d_ino 1627903676, d_off 1627903676 d_reclen 0 d_namlen
0 d_name
d_ino 1627903676, d_off 1627903676 d_reclen 0 d_namlen
0 d_name
d_ino 1627903676, d_off 1627903676 d_reclen 0 d_namlen
0 d_name
Thanks
Markus
__________________________________________________________________
Do You Yahoo!?
Gesendet von Yahoo! Mail - http://mail.yahoo.de
More information about the users
mailing list