Mail Archives: djgpp-workers/1996/10/03/04:41:30
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 -