Date: Thu, 3 Oct 1996 10:37:00 +0200 (IST) From: Eli Zaretskii To: Daisuke Aoyama , djgpp-workers AT delorie DOT com Cc: DJ Delorie Subject: Re: bash 1.14.7 is available In-Reply-To: Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.