delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/10/03/04:41:30

Date: Thu, 3 Oct 1996 10:37:00 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Daisuke Aoyama <jack AT st DOT rim DOT or DOT jp>, djgpp-workers AT delorie DOT com
Cc: DJ Delorie <dj AT delorie DOT com>
Subject: Re: bash 1.14.7 is available
In-Reply-To: <Pine.SUN.3.91.960929085327.20703B-100000@is>
Message-Id: <Pine.SUN.3.91.961003102814.27330L-100000@is>
Mime-Version: 1.0


On Sun, 29 Sep 1996, I wrote:

> "test -x" seems to not work.  In one script that I tested,
> "if [ -x bin/emacs.exe ]" returned false, while if I replace "-x" with 
> "-f", it returns true.

I think I know why this is happening.  I saw the same problem in the 
`test' stand-alone program from GNU Sh-utils (the source seems to be 
common to `bash').  They use `eaccess' to test for the accessibility, and 
that function assumes that the R_OK, W_OK and X_OK have the same bit 
positions as the read, write, and execute bits in the st_mode field of 
struct stat.  In other words, the assume that the following hold:

	R_OK = S_IROTH
	W_OK = S_IWOTH
	X_OK = S_IXOTH

This assumption is wrong in DJGPP.  Just make `eaccess' call `access' 
instead and the problem will go away.

I'd appreciate if you could make this patch and put the patched binary on 
your usual places.  This problem stops me from moving on with some 
complex shell scripts.  Thanks.

Btw, DJ: should we maybe make the above assumption work in v2.01? If GNU 
assume this in a public package, it must be a de-facto standard.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019