Mail Archives: djgpp-workers/2002/12/01/01:24:05
On Sun, 1 Dec 2002, Andrew Cottrell wrote:
> Does anyone have any problems with this change?
>
> New code:
> #if defined(HAVE_DIR_EACCES_BUG) || defined(DJGPP)
> # ifdef EISDIR
> # define is_EISDIR(e, f) \
> ((e) == EISDIR \
> || ((e) == EACCES && isdir (f) && ((e) = EISDIR, 1)))
> # else
> # define is_EISDIR(e, f) ((e) == EACCES && isdir (f))
> # endif
> #endif
[...]
> 2) The isdir() is a new for 2.5.1 and consists of the following :-
> int isdir (const char *path)
> {
> struct stat stats;
> return stat (path, &stats) == 0 && S_ISDIR (stats.st_mode);
> }
If it's possible, I'd sugget to use `access' instead of `isdir', since
the former is much faster on DJGPP platforms (`stat' is very expensive,
while `access' is mostly a single system call).
Otherwise, fine; please submit this to the Grep maintainer. Thanks for
working on this.
- Raw text -