FindFirstFile&FindNextFile equivalent?
hi, im porting a game from windows to linux and i need to exchange the FindFirstFile and FindNextFile win32 functions.
i need to know the linux equivalents.
cody
February 15, 2002 11:20 AM
readdir() and family (opendir, readdir, telldir, closedir, rewinddir, dirfd). On Linux and BSD, there is also scandir() and alphasort(). I don''t remember if there is a SysV equivalent, but there ought to be.
yeah, i found these functions, however im wondering how i know if a value returned by readdir() is a directory or a file.
struct stat info;struct dirent *ent;/* Fill ent from readdir */stat(ent->d_name, &info);if(info.st_mode & S_IFDIR) printf("It''s a directory.\n");
Look in the man pages for more information on stat.
thx!
the problem is that i cant use my linux right now because i dont know where the cable of the linux-harddisk is. :-)
the problem is that i cant use my linux right now because i dont know where the cable of the linux-harddisk is. :-)
February 15, 2002 07:24 PM
The man page for ''stat'' (and about everything else related to Unix) can be found at www.freebsd.org, under "documentation->more...". That way you''re not stuck until you find that cable.
And of course, google is your friend.
And of course, google is your friend.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement