|
From: Eli Z. <el...@gn...> - 2015-02-06 19:09:01
|
> Date: Fri, 6 Feb 2015 19:08:39 +0100 > From: Miro Kropáček <mir...@gm...> > > Can you tell why you need to access the members of DIR? > > > Well, it's not my project, it's someone else's. It's used like this: > > #define DIRHANDLE dirp->dd_handle > > DIR *dirp; > > if ((dirp = opendir(dirname)) == NULL) > return(-1); > > if (fstat(DIRHANDLE, &stb) < 0) > return(-1); > > Not saying it's a great practice, though. So I'd like to make it compilable > somehow, it works for other Unix flavors, incl. Cygwin. That's unportable code. Just stat the directory instead. |