Mail Archives: djgpp/2001/06/07/16:41:17
> However, if findfirst is called, it means that the preceding call to
> _chmod failed, and that is already a sign of trouble.
> ...
> As you see, findfirst is called only if _chmod returns -1, meaning
> that it failed. Could you please look inside _chmod and see what
> happens there, and what is the DOS error code returned in the AX
> register by __dpmi_int called from _chmod?
Call to _chmod( ) fails with the following results:
R.X.AX = 3
R.X.AX_HI = 0x2D
errno = 22
> As for findfirst, in addition to the carry flag being set, __dpmi_int
> also returns an error code in regs.x.ax. Please see what is the value
> of this.
Call to findfirst( ) fails with the following results:
R.X.AX = 3
R.X.AX_HI = 0x2D
errno = 22
> Finally, it might be important to know what does _fixpath return in
> the fixed_path[] string, because that's the file name we pass to
> findfirst.
> _fixpath(fn, fixed_path);
> if (fixed_path[1] == ':' && fixed_path[2] == '/' && fixed_path[3] == 0)
> {
> char *fp = fixed_path + 3;
>
> *fp++ = '*';
> *fp++ = '.';
> *fp++ = '*';
> *fp++ = '\0';
> /* Use _lfn_close_handle so we don't lose a handle. */
> if (findfirst(fixed_path, &ff, FA_DIREC) == 0)
Actually, the findfirst( ) is not called from this place, because
fixed_path[] contains "d:/cd4000/probe.tc/nametest.exe"
( Why? Isn't it should be "d:/cd4000/probe.tc/foo/nametest.exe" ? )
The one that is called is from here (in access( ) ):
...
/* Devices also fail `_chmod'; some programs won't write to
a device unless `access' tells them they are writeable. */
ret_code = findfirst(fn, &ff, FA_RDONLY | FA_ARCH); // <== This is where
it fails
if (ret_code == 0 && (ff.ff_attrib & 0x40) == 0x40
&& (flags & (X_OK | D_OK)) == 0)
{
if (strcmp(ff.lfn_magic, "LFN32") == 0)
_lfn_find_close(ff.lfn_handle);
return 0;
}
errno = ENOENT;
return -1;
...
> Thanks again for working on this.
It's my pleasure.
Alex
- Raw text -