X-Authentication-Warning: new-smtp1.ihug.com.au: Host p410-tnt2.syd.ihug.com.au [203.173.131.156] claimed to be acceleron Message-ID: <00af01c12197$68628570$0a02a8c0@acceleron> From: "Andrew Cottrell" To: "Eli Zaretskii" Cc: , References: <007701c120c6$2d72db80$0a02a8c0 AT acceleron> <7458-Thu09Aug2001183844+0300-eliz AT is DOT elta DOT co DOT il> Subject: Re: Windows 2000 patch for utime.c v1 Date: Fri, 10 Aug 2001 22:24:29 +1000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_00AC_01C121EB.38DEA0F0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Reply-To: djgpp-workers AT delorie DOT com This is a multi-part message in MIME format. ------=_NextPart_000_00AC_01C121EB.38DEA0F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > > > 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. > > All of the sub functions wrt to time appeared to work when I tested them. > > Btw, did they work on directories, i.e. could you change the time > stamp of a directory? Yes I could change the time stamp of a directory on Win 2K. On Win 98 when I tested it I could not change the timestamp of a directory. The touch.exe from the fil40b.zip on Simtel gives an EACCESS error. The touch.exe that i built using the CVS LIBC and the attached patch file also gives the same EACCESS error on Win 98 and Win 2K. The patch file from yesterday does not fail on Win 2K. Should setting time on a directory fail? If it should not fail then should I put this on my list of items to come back to. To save time again i have attached an updated utime.c patch that fails when trying to set the time on a directory as occurs with the exisiting code on Win 9x. AS I see it it is better to have them consistent than different. ------=_NextPart_000_00AC_01C121EB.38DEA0F0 Content-Type: application/octet-stream; name="utime_3.dif" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="utime_3.dif" *** utimeold.c Sun Mar 11 00:10:04 2001 --- utime.c Fri Aug 10 22:23:14 2001 *************** *** 1,3 **** --- 1,4 ---- + /* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include *************** *** 8,13 **** --- 9,16 ---- #include /* For errno */ #include #include + #include + #include /* An implementation of utime() for DJGPP. The utime() function specifies an access time and a modification time. DOS has only one *************** *** 41,46 **** --- 44,81 ---- dostime = tm->tm_sec / 2 + (tm->tm_min << 5) + (tm->tm_hour << 11); + if (_osmajor == 5 && + (_USE_LFN) && + (_get_dos_version(1) == 0x532)) /* LFN and NT (or 2000 or XP) */ + { + + _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 extended get and set time */ + r.x.bx = 0x03; /* Set last write date / time */ + __dpmi_int(0x21, &r); + + if (!(r.x.flags & 1)) /* Pass then continue */ + { + /* Uses date allready in r.x.di */ + r.x.ax = 0x7143; /* LFN API for extended get and set time */ + r.x.bx = 0x05; /* Set last access date / time */ + __dpmi_int(0x21, &r); + if (!(r.x.flags & 1)) /* Pass then continue */ + { + /* Close the file as we are exiting */ + (void) close(fildes); + return 0; + } + } + } + /* Set the file timestamp */ r.h.ah = 0x57; /* DOS FileTimes call */ r.h.al = 0x01; /* Set date/time request */ ------=_NextPart_000_00AC_01C121EB.38DEA0F0--