Mail Archives: djgpp-workers/2001/08/08/11:29:05
On Wed, 8 Aug 2001, Andrew Cottrell wrote:
> Here is my first attempt at a patch to fix the problem with utime under
> Windows 2000.
Thanks! Comments below.
> Should I change the code to execute the new check for all versions of
> Windows or only NT or ....?
If most other versions of Windows fail with 7143h, I think we shouldn't
call it unless on NT/W2K/XP.
> + #include <libc\dosio.h>
Please always use the (much more portable) forward slash. The above will
not compile in cross-compiled environment.
> + if ((_USE_LFN) && ( _osmajor < 7 || _osmajor > 9)) /* LFN & NT */
This is not the right way to test for NT/W2K. Please use this:
if (_osmajor == 5
&& _USE_LFN
&& _get_dos_version (1) == 0x532) /* LFN & NT */
> + _put_path(path);
> + r.x.ds = __tb_segment; /* DS:DX -> ASCIZ filename */
> + r.x.dx = __tb_offset;
> +
> + r.x.cx = dostime; /* New time */
> + r.x.di = dosdate; /* New date */
> + r.x.si = 0x00; /* Set to zero just in case */
> +
> + r.x.ax = 0x7143; /* LFN API for extend3ed get/set time */
There's a typo in the comment here.
> + r.x.bx = 0x03; /* Set last write date / time */
> + __dpmi_int(0x21, &r);
> +
> + if (!(r.x.flags & 1)) /* Pass exit otherwise try other methods */
> + {
> + return 0;
I think we should set access date/time as well (using subfunction 05),
like we do on Windows 9X. Please see if subfunction 05 works, and if
so, does it support setting the access time, not only date.
Thanks again for working on this.
- Raw text -